How do I access the PageBlock content_id
How do I access the PageBlock content_id
Hi,
I want to use the content_id of a pageblock as a unique ID to create a variable that I can use within that pageblock multiple times. This variable will be passed to custom tags to generate different screen data. You can get the content_id of the main page easy enough, but I don't see how to access a pageblocks content_id.
Thanks in advance for any help.
Terry
I want to use the content_id of a pageblock as a unique ID to create a variable that I can use within that pageblock multiple times. This variable will be passed to custom tags to generate different screen data. You can get the content_id of the main page easy enough, but I don't see how to access a pageblocks content_id.
Thanks in advance for any help.
Terry
Re: How do I access the PageBlock content_id
Have you tried tag {get_template_vars}?
This one shows you every available smarty variable.
This one shows you every available smarty variable.
Re: How do I access the PageBlock content_id
Hi,
That gives you the content_id of the main CMSMS page, but it appears that the PageBlock module pulls content_ids for it's blocks from the same table as the CMSMS does, probably so it doesn't ever get confused. So, the content_ids of PageBlocks is not displayed with the "get_template_vars" tag.
Terry
That gives you the content_id of the main CMSMS page, but it appears that the PageBlock module pulls content_ids for it's blocks from the same table as the CMSMS does, probably so it doesn't ever get confused. So, the content_ids of PageBlocks is not displayed with the "get_template_vars" tag.
Terry
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: How do I access the PageBlock content_id
I'm going to try to add this feature (as soon as I move over to our other computer).tmoynih1 wrote: Hi,
I want to use the content_id of a pageblock as a unique ID to create a variable that I can use within that pageblock multiple times. This variable will be passed to custom tags to generate different screen data. You can get the content_id of the main page easy enough, but I don't see how to access a pageblocks content_id.
Thanks in advance for any help.
Terry
It shouldn't be hard, and it should make PageBlocks much more useful.

Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: How do I access the PageBlock content_id
Well, I got quite distracted today with other things. I hope to maybe get this done tomorrow. I need to head to bed now.Elijah Lofgren wrote:I'm going to try to add this feature (as soon as I move over to our other computer).tmoynih1 wrote: Hi,
I want to use the content_id of a pageblock as a unique ID to create a variable that I can use within that pageblock multiple times. This variable will be passed to custom tags to generate different screen data. You can get the content_id of the main page easy enough, but I don't see how to access a pageblocks content_id.
Thanks in advance for any help.
Terry
It shouldn't be hard, and it should make PageBlocks much more useful.![]()
Good night,
Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: How do I access the PageBlock content_id
Done: http://viewsvn.cmsmadesimple.org/viewsv ... s&view=revtmoynih1 wrote: Hi,
I want to use the content_id of a pageblock as a unique ID to create a variable that I can use within that pageblock multiple times. This variable will be passed to custom tags to generate different screen data. You can get the content_id of the main page easy enough, but I don't see how to access a pageblocks content_id.
Thanks in advance for any help.
Terry

You can download this file: http://viewsvn.cmsmadesimple.org/viewsv ... iew=markup
and replace your current modules/PageBlocks/action.default.php file with it.
Then you can call PageBlocks like this:
Code: Select all
{cms_module module='pageblocks' page_id='15'}
Elijah
Hmmm... I just read your post again and I don't think this is what you were wanting. LOL. At least it's a feature others will find useful.

Well, It shouldn't be hard to make the page blocks id into a template var.... It wasn't.

http://viewsvn.cmsmadesimple.org/viewsv ... s&view=rev
You can either download the changed file here: http://viewsvn.cmsmadesimple.org/viewsv ... iew=markup
and replace your current modules/PageBlocks/classes/class.Text.php with it.
Or you can just open modules/PageBlocks/classes/class.Text.php
Find:
Code: Select all
$module->smarty->assign('title', $this->mName);
Code: Select all
$module->smarty->assign('pageblock_id', $this->Id());
Code: Select all
{$pageblock_id}
Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: How do I access the PageBlock content_id
Hi Elijah,
Thanks, the last part is what I was looking for. I didn't want to reinvent the wheel, and I new the you were pulling the id out of the content_id table, but couldn't easily find how to access and use it. This is a case of being able to input a piece of information once in a page block and then use it in different ways in the block. i.e. as a link, as text, etc. and formatted differently.
Thanks again.
I appreciate your time and effort.
Regards,
Terry
Thanks, the last part is what I was looking for. I didn't want to reinvent the wheel, and I new the you were pulling the id out of the content_id table, but couldn't easily find how to access and use it. This is a case of being able to input a piece of information once in a page block and then use it in different ways in the block. i.e. as a link, as text, etc. and formatted differently.
Thanks again.
I appreciate your time and effort.
Regards,
Terry
Re: How do I access the PageBlock content_id
It does not seem to work for me.
I got a Pageblock where I show a list off drivers in my team:
http://staging.culas.nl/degensimracingt ... s/2008wtcc
Now I want to have a single page for the driver itself using the same content on
http://staging.culas.nl/degensimracingt ... s/2008wtcc but filter only one driver.
So only show content of ID 51 on:
http://staging.culas.nl/degensimracingt ... -loeffler/
In the content field
of http://staging.culas.nl/degensimracingt ... -loeffler/
I've placed this code: {cms_module module='pageblocks' page_id='53'}
With doesn't seem to be working for me.
I got a Pageblock where I show a list off drivers in my team:
http://staging.culas.nl/degensimracingt ... s/2008wtcc
Now I want to have a single page for the driver itself using the same content on
http://staging.culas.nl/degensimracingt ... s/2008wtcc but filter only one driver.
So only show content of ID 51 on:
http://staging.culas.nl/degensimracingt ... -loeffler/
In the content field
of http://staging.culas.nl/degensimracingt ... -loeffler/
I've placed this code: {cms_module module='pageblocks' page_id='53'}
With doesn't seem to be working for me.
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
Re: How do I access the PageBlock content_id
Showing a specific block id is not currently possible (the page_id parameter parameter shows the blocks of a specific page, not a specific block id)culas wrote: It does not seem to work for me.
I got a Pageblock where I show a list off drivers in my team:
http://staging.culas.nl/degensimracingt ... s/2008wtcc
Now I want to have a single page for the driver itself using the same content on
http://staging.culas.nl/degensimracingt ... s/2008wtcc but filter only one driver.
So only show content of ID 51 on:
http://staging.culas.nl/degensimracingt ... -loeffler/
In the content field
of http://staging.culas.nl/degensimracingt ... -loeffler/
I've placed this code: {cms_module module='pageblocks' page_id='53'}
With doesn't seem to be working for me.
I don't have much time, but it wasn't too hard to quickly add a show_block_id parameter.
Here's a patch to make it so you can display a single block id wherever you want:
http://www.elijahlofgren.com/uploads/cm ... meter.diff
Here's patch against the released version of the released pageblocks: http://www.elijahlofgren.com/uploads/cm ... eter.patch
You can ignore the above patches, and just do this in order to try out the show_block_id parameter:
1. Download the attached action.default.php.txt file which includes the above changes.
2. Rename it to action.default.php
3. Overwrite your current modules/PageBlocks/action.default.php with it.
4. In your page replace this code:
Code: Select all
{cms_module module='pageblocks' page_id='53'}
Code: Select all
{cms_module module='pageblocks' show_block_id='53'}
I hope this helps,
Elijah Lofgren
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Solved [How do I access the PageBlock content_id]
Yes it works!
This is great, now we can really work with global content. Just as {cms_module module='pageblocks' show_block_id='53'}
in a the content area and of you go:
http://simracingteam.degen.be/the-drive ... s-loeffler
Now we can make one content block, and use it on more than one page.
Great thanks mate
This is great, now we can really work with global content. Just as {cms_module module='pageblocks' show_block_id='53'}
in a the content area and of you go:
http://simracingteam.degen.be/the-drive ... s-loeffler
Now we can make one content block, and use it on more than one page.
Great thanks mate
Last edited by Lucaz on Thu Oct 23, 2008 8:01 am, edited 1 time in total.