New page from template?

Hi,



Is there any way that I can make a new page from a template to display in the middle column?



I don’t want to use the CMS system thats built in for this particular page as I don’t want to use the same layout.



EG… I make a new template called “new_page.tpl” and to display this in the middle column I’d type something like index.php?target=new_page.



Anyone have any ideas?

Simon

Exactly,



Step 1, make your new tpl file, call it “xyz.tpl”.



I myself would probably make a new folder under /skins/skin_name/customer/CUSTOM/

and dump the .tpl in there.



2. You need edit this file

/skins/skin_name/customer/content.tpl



The last 8 or so lines read

```php {[ADDONS_DATA]}

{elseif $content == “news”}

{include file=“addons/news_and_emails/news.tpl”}



{[/ADDONS_DATA]}



{else}

{include file=“welcome.tpl”}

{/if}

```
just below [/ADDONS_DATA]**} I would add my own CUSTOM addons and make sure u comment it
```php
{** CUSTOM TPLS **}
{elseif $content == "xyz"}
{include file ="custom/xyz.tpl"}
{** END CUSTOM TPLS **}
```
Thats all you need, now when you target=xyz, the new tpl should appear.

Try it out, let me know...its late and i havent actually coded any of this.

hi ETI, it doesn’t work for me… any idea? :o

I have yet to try it… I might give it a go later if I finish changing over to 1.3.3.

sorry i was away on a trip, just got back. I will look into it, when I get a free moment.

thank you guys! :mrgreen:

I’ve tried about everyting I can think of, gonna have to ask CS on this one…



Above code would work on X, but not on CS…Sorry.

ok thanks. Hopefully it can be done, it’ll make my life a lot easier - especially if I can use the language variables in here too!



Simon

hi, any news about this matter? :slight_smile:

I have not had time to look into it yet and as I don’t have any support time left I can’t ask CS directly, unless they see this thread and help us out!



I’ll update the thread if I ever get any further though.



Simon

Hello,



Tony was very close to the solution :):slight_smile:



Here it is corrected.



Step 1, make your new tpl file, call it “xyz.tpl”.



I myself would probably make a new folder under /skins/skin_name/customer/CUSTOM/ and dump the .tpl in there.



2. You need edit this file

/skins/skin_name/customer/content.tpl



The last 8 or so lines read

{**[ADDONS_DATA]**}
{elseif $content == "news"}
{include file="addons/news_and_emails/news.tpl"}

{**[/ADDONS_DATA]**}

{else}
{include file="welcome.tpl"}
{/if}
just below [/ADDONS_DATA]**} I would add my own CUSTOM addons and make sure u comment it


{** CUSTOM TPLS **}
{elseif $smarty.get.info_page == "xyz"}
{include file ="CUSTOM/xyz.tpl"}
{** END CUSTOM TPLS **}




Thats all you need, now when you call index.php with info_page=xyz, the new tpl should appear:

[URL=“YourStore | Search Engine Optimization For eCommerce Brands”]YourStore | Search Engine Optimization For eCommerce Brands



This should work fine.

Fantastic, I’ll try that out sometime. Should help me out a bit. Many thanks.



Simon

[quote name=‘admin’]Hello,



Tony was very close to the solution :):slight_smile:



Here it is corrected.



Step 1, make your new tpl file, call it “xyz.tpl”.



I myself would probably make a new folder under /skins/skin_name/customer/CUSTOM/ and dump the .tpl in there.



2. You need edit this file

/skins/skin_name/customer/content.tpl



The last 8 or so lines read

{**[ADDONS_DATA]**}
{elseif $content == "news"}
{include file="addons/news_and_emails/news.tpl"}

{**[/ADDONS_DATA]**}

{else}
{include file="welcome.tpl"}
{/if}
just below [/ADDONS_DATA]**} I would add my own CUSTOM addons and make sure u comment it


{** CUSTOM TPLS **}
{elseif $smarty.get.info_page == "xyz"}
{include file ="CUSTOM/xyz.tpl"}
{** END CUSTOM TPLS **}




Thats all you need, now when you call index.php with info_page=xyz, the new tpl should appear:

[URL=“YourStore | Search Engine Optimization For eCommerce Brands”]YourStore | Search Engine Optimization For eCommerce Brands



This should work fine.[/QUOTE]



Now here’s a noob question for ya… in the code example above in your custom tpls section you have the {elseif $smarty.get.info_page==“xyz”} line, just what can the “xyz” actually be? I mean, would “xyz” actually be a page name like “page_name.php” or what can that value be? Don’t know if I’m asking this question right… is “xyz” an actual page name or is it a variable or what can it be? Thanks,

j

actually the “xyz” used in the example means that you have to insert the .tpl file name there. Let’s say you would like to have a custom page “about us”, then, you will have to create a “about_us.tpl” file (that includes all your html code) and as indicated in the code above, instead of “xyz.tpl” you will have to insert “about_us.tpl” for this example. Doing so, if you point your browser to www.yoursite.com/index.php?info_page=about_us it will display the custom page.



hope it makes sense :slight_smile:



@admin: thanks for the tip, I will try it later today!

Ahh… think I get it. Basically like a function call to that page. Gotchya.

j

If you want a basic page, listed in the site info area, just use the CMS.



I only asked about this as I want some pages that are;


  1. Laid out differently to the general CMS pages
  2. Not shown on the site info menu



    Now… Is it possible to limit these pages by user group? So if a user does not belong to a particular group, they will not be able to view the page. Any ideas?

[quote name=‘admin’]Hello,



Tony was very close to the solution :):slight_smile:



Here it is corrected.



Step 1, make your new tpl file, call it “xyz.tpl”.



I myself would probably make a new folder under /skins/skin_name/customer/CUSTOM/ and dump the .tpl in there.



2. You need edit this file

/skins/skin_name/customer/content.tpl



The last 8 or so lines read

{**[ADDONS_DATA]**}
{elseif $content == "news"}
{include file="addons/news_and_emails/news.tpl"}

{**[/ADDONS_DATA]**}

{else}
{include file="welcome.tpl"}
{/if}
just below [/ADDONS_DATA]**} I would add my own CUSTOM addons and make sure u comment it


{** CUSTOM TPLS **}
{elseif $smarty.get.info_page == "xyz"}
{include file ="CUSTOM/xyz.tpl"}
{** END CUSTOM TPLS **}




Thats all you need, now when you call index.php with info_page=xyz, the new tpl should appear:

[URL=“YourStore | Search Engine Optimization For eCommerce Brands”]YourStore | Search Engine Optimization For eCommerce Brands



This should work fine.[/QUOTE]









Nope, this didnt work, when i reloaded my site i only got the left side boxes and nothing else

I’ve integrated 6 new content pages with this method, it works great! Are you sure that everything is set correctly on your files Lisa?

if youve done it then i must be doing something wrong. i thought i copied the instructions correctly, mabey ill try again

i think i put the code in the wrong place, my page loads fine now. now i just have to link it in the cms so it comes up there. thanks