XF 1.1 How to get the current thread id being viewed in the page_container_js_head template?

robdog

Well-known member
Licensed customer
Working with good DFP and I need to see if there is a valid thread_id.

Any ideas?
 
Edit this template:

Admin CP -> Appearance -> Templates -> thread_view

Add this line to the top of each template:

Code:
<xen:container var="$threadId">{$thread.thread_id}</xen:container>

Now you can use {$threadId} in the PAGE_CONTAINER and other templates, and in conditions like this:

Code:
<xen:if is="{$threadId} == 2">

</xen:if>
 
For example: I want to write a block/module for xenporta, I want to get the current threadid's article view.

You would have to write code to query the thread record and make it available to the block. This involves custom programming, not just template functions.
 
sure.

But this block/module is not render the article, because xenporta do before. It is just get the current threadid of xenporta's view and and want to use it in my custom module/block.

For example: display more articles exclude the current in the list below the current article.

Is there anyway to do? Thanks so much!
 
I am not familiar with the code behind XenPorta's block system. I don't know how the scope works. If the blocks are in the container scope then my previous code will work (using xen:container).
 
Back
Top Bottom