PDA

View Full Version : Referencing original thread URL from vBCMS Article


cash7c3
10-31-2014, 11:05 AM
Hello, I'm having all sorts of difficulty passing a variable in a CMS article template (header) to output the original thread URL. Please advise how to do this.

cash7c3
11-03-2014, 09:52 AM
Bump.

Lynne
11-03-2014, 04:31 PM
So you created an article from a thread and need to somehow pass the threadid in the header template? What have you tried so far? Have you verified there is a cms_article.threadid that exists for that particle article?

cash7c3
11-03-2014, 05:10 PM
I had this in there:

<vb:if condition="$promoted_threadid">
<link rel="canonical" href="{vb:raw vboptions.bburl}/showpost.php?{vb:raw session.sessionurl}p={vb:raw postid}"/>
</vb:if>

But that's the other way around (links to the forum post). I'd like to link it FROM the thread TO the article.

Lynne
11-04-2014, 03:59 PM
So, you are putting that code into the header template on the showthread page and hoping to link to the article id (it sounded like before, you were wanting to link to the threadid). If you want to link to the article, you will need to do a query to get the article id before you can actually post a link to it.

cash7c3
11-04-2014, 04:04 PM
Real example:

http://modmyi.com/content/16967-apple-set-issue-bonds-euros-due-low-interest-rates.html is an article page.

It's original thread is http://modmyi.com/forums/mac-news/841432-apple-set-issue-bonds-euros-due-low-interest-rates.html

In the THREAD header, I would like this code:

<link rel="canonical" href="http://modmyi.com/content/16967-apple-set-issue-bonds-euros-due-low-interest-rates.html"/>

I am not terribly opposed to it being the other way around, but prefer the canonical link to be the article URL.

I do not know how to do that, and am hoping someone can assist. I don't know how to do a query to get the article id, nor what to do with it when I get it.

cash7c3
11-07-2014, 09:53 AM
Bump.

Lynne
11-07-2014, 04:38 PM
Well, as I said, you would need to write a query to get the article id. I have no idea how to then take that and make an SEO link out of it. You may want to hire somebody if you are unsure how to do that.