Building inteligent templates

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
DreamworlD
New Member
New Member
Posts: 3
Joined: Wed Sep 28, 2011 4:13 pm

Building inteligent templates

Post by DreamworlD »

Hi there,
Excuse me if this is not the right place to ask, this is my very first post and I am a little bit frustrated after more than 12 hours search for a solution.
I've the following Site structure (with the corresponding urls):

Code: Select all

Home -> cmssite.com/home
Products -> cmssite.com/products
+-ProductCategoryOne  -> cmssite.com/ProductCategoryOne
|-Products1 -> cmssite.com/ProductCategoryOne/Products1
|-Products2 -> cmssite.com/ProductCategoryOne/Products2
|-Products3 -> cmssite.com/ProductCategoryOne/Products3
+-ProductCategoryTwo -> cmssite.com/ProductCategoryTwo
|-Products1 -> cmssite.com/ProductCategoryTwo/Products1
|-Products2 -> cmssite.com/ProductCategoryTwo/Products2
|-Products3 -> cmssite.com/ProductCategoryTwo/Products3
+-ProductCategoryThree -> cmssite.com/ProductCategoryThree
|-Products1 -> cmssite.com/ProductCategoryThree/Products1
|-Products2 -> cmssite.com/ProductCategoryThree/Products2
|-Products3 -> cmssite.com/ProductCategoryThree/Products3
+-ProductCategoryFour -> cmssite.com/ProductCategoryFour
....
About Us -> cmssite.com/aboutus
My very ideia is that for some of products inside the ProductCategories i need a title in the content of the ProductsX pages, for others I do not.
(I do not like to use a different template for the products because I should build six different templates for six different languages already. This site is on six languages.)
I tried to build this with smarty logic:

Code: Select all

{if $position eq 2.1.1}
<p>{title}</p>
{/if}
but this one is working only for one single of the pages. Unfortunately in smarty there's no such method as in Java Language contains(String string) so that I can specify that I would like to search in the position variable for 2.x
I tried also with a UST: one that is getting the URL and returning 1 if the string ProductCategory is contained in and 0 if not. But I didn't manage to sort out how to assign the return parameter with a variable inside the smarty logic.
I was thinking to embed PHP code inside, but then I realized that I won't be able to echo out the title variable since it is somewhat associated with a smarty one, and it is containing somewhere inside the global cms variables, so I should import them.

May I ask some of you guys give me a slight hint how to sort out this issue.
Thanks in advance
Post Reply

Return to “CMSMS Core”