Page 1 of 1

Custom Static Page Template

Posted: Sun Jan 24, 2010 12:12 am
by Maccsta
I want to remove the date and the author from the bottom of my static pages.
What would the best way to do this?

I was going to create a new template by altering the default one and uploading it somewhere else. Then use the ‘Page types’ feature within the plugin to select my custom template.

Where is the best place to store this custom template and avoid deletion when the plugin updates?

Thanks in advance :)

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 2:15 pm
by stm999999999
you can put your own staticpage.tpl into your selected template folder.

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 2:41 pm
by Maccsta
stm999999999 wrote:you can put your own staticpage.tpl into your selected template folder.

So in the mydomain.com/templates/

or

Making a folder templates in the plugin directory?

mydomain.com/plugins/pluginsserendipity_event_staticpage/templates/

I just don't want it overwriting when the plugin updates!

Thanks!

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 4:11 pm
by yellowled
Maccsta wrote:So in the mydomain.com/templates/
mydomain.com/templates/your_template/, actually.

You can do this with any plugin's tpl files (if there are any), and as long as your template doesn't provide the tpl file in question, it won't be overwritten since the copied tpl file is not part of the original template.

YL

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 4:38 pm
by Maccsta
yellowled wrote:
Maccsta wrote:So in the mydomain.com/templates/
mydomain.com/templates/your_template/, actually.

You can do this with any plugin's tpl files (if there are any), and as long as your template doesn't provide the tpl file in question, it won't be overwritten since the copied tpl file is not part of the original template.

YL
Thanks!

However It's not working out. I have made the custom template and uploaded it here:

mydomain.com/templates/static_page/custom_static_page.tpl

Gone to the static page interface selected page types ----> new entry

Description: Custom Article
Template Name: /templates/static_page/custom_static_page.tpl
Image path: left blank



Created a new page with Custom Article as the article type.

When I load up the page I get this error:

Warning: Smarty error: unable to read resource:
"file:/mydomain.co.uk/public_html/blog/plugins/serendipity_event_staticpage/custom_static_page.tpl" in /mydomain.co.uk/public_html/blog/bundled-libs/Smarty/libs/Smarty.class.php on line 1093



Any idea what I've done wrong?

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 6:33 pm
by stm999999999
two things:

Template Name: /templates/static_page/custom_static_page.tpl

here you have to write only the name of the tpl, not the path - IIRC the plugin looks first in the actual template folder and then in his plugin folder.

and:

/templates/static_page/custom_static_page.tpl

Your are sure your template (I mean the template for your whole blog!) has the name "static_page"?

Re: Custom Static Page Template

Posted: Sun Jan 24, 2010 7:01 pm
by Maccsta
Ok I got it working by adding the custom template direct to staticplugin folder.

However I see what you mean I wasn't adding it to the template folder for my whole blog. I was creating a new folder and it expecting it to find it there, that's why I thought the path was needed.

Thanks a ton for the help, works great now. :)