Hi,
I'm trying to use multiple content blocks (using the 'block' parameter of the {content} tag) in templates that are being included (using the {include file="blah"} tag, but only the first/main content block is being output on the page.
Is this a known bug/issue, or is there something I need to do to get this to work?
It works fine if I put the {content} tags directly into the template textarea in the admin system but not when they're in included files.
Any help would be greatly appreciated.
Matt
Multiple content blocks in included template files
Re: Multiple content blocks in included template files
Think file blah is not parsed by smarty - on parsing it's only read and insert like copy and paste so it can't work ...
Re: Multiple content blocks in included template files
That was what I wondered, but CMS tags (e.g. {description} etc. and also the first {content} tag) are still getting parsed as their values are being output onto the page. It's only the {content block="something"} tags that aren't getting output (and CMS isn't creating an additional editor for).
Re: Multiple content blocks in included template files
Anyone got any ideas how I might get around this?? Can I add some custom code into the CMSMS core files or something to make this work? I really need a way of being able to use multiple content blocks and included/external template files.
Re: Multiple content blocks in included template files
Have read a little bit in smarty doc - {include} should only used for inserting template files. Are you sure your pathes are right? Base directory for templates is not CMSms root directory.mattots wrote: Anyone got any ideas how I might get around this??
What's the reason for? If you want you can create a special template for every pagemattots wrote: I really need a way of being able to use multiple content blocks and included/external template files.

Re: Multiple content blocks in included template files
I've used multiple content blocks on pages before, in this format in the template, up to if not more than 6 times, firefox has been known the continue to spin like it's still buzy...
{content block='news1'}, content block='content2', content block='something' should work, try single quotes....
{content block='news1'}, content block='content2', content block='something' should work, try single quotes....
Re: Multiple content blocks in included template files
Sorry, not had time to log on to the forum for AGES. Reading the replies, I don't think my original question has been properly understood.
I know that multiple content blocks can be inserted into a template when you are simply coding the template directly into the template textarea in CMS admin. As Mark describes I have seen a similar thing happen with Firefox seeming to constantly be trying to load the page, although it is still usable.
However, I build all my templates as external .tpl files - these are saved in the tmp/templates folder and then simply referenced in the template textarea in CMS using {include file="mytemplate.tpl"}.
This works absolutely great and with no problems - the main advantage being I can work directly on the files in a text editor rather than having to work in the nasty textarea in CMS. Smarty tags etc. all work fine etc.
Where there IS a problem, and this was my original query, is when you try to add the 'block' paramteter to the {content} tag in an external template file (as just described), it doesn't have any effect. This is strange since all other smarty tags and parameters seem to work fine.
cyberman, you asked why I wanted to do this and said I could create a special template for every page. I don't see the relevance of what you said - the case stands even if I was only building a one page website! I'm talking about having for example two divs on the page that you want to be editable as seperate content blocks. At the moment I'd have to include the structural markup for the divs inside the content area, which is far from ideal as I only want site users to be able to edit the content, not the layout of a page.
Hope this clarifies my original question, and hoping that after all this time someone might still be able to come up with an answer!!
I know that multiple content blocks can be inserted into a template when you are simply coding the template directly into the template textarea in CMS admin. As Mark describes I have seen a similar thing happen with Firefox seeming to constantly be trying to load the page, although it is still usable.
However, I build all my templates as external .tpl files - these are saved in the tmp/templates folder and then simply referenced in the template textarea in CMS using {include file="mytemplate.tpl"}.
This works absolutely great and with no problems - the main advantage being I can work directly on the files in a text editor rather than having to work in the nasty textarea in CMS. Smarty tags etc. all work fine etc.
Where there IS a problem, and this was my original query, is when you try to add the 'block' paramteter to the {content} tag in an external template file (as just described), it doesn't have any effect. This is strange since all other smarty tags and parameters seem to work fine.
cyberman, you asked why I wanted to do this and said I could create a special template for every page. I don't see the relevance of what you said - the case stands even if I was only building a one page website! I'm talking about having for example two divs on the page that you want to be editable as seperate content blocks. At the moment I'd have to include the structural markup for the divs inside the content area, which is far from ideal as I only want site users to be able to edit the content, not the layout of a page.
Hope this clarifies my original question, and hoping that after all this time someone might still be able to come up with an answer!!