CustomField for Static Pages?
Posted: Tue Feb 20, 2007 11:27 pm
Is there any way of modifying the StaticPage-plugin so that StaticPages can also include CustomFields? Thanks in advance.
There would be a way, of using PHP code to enhance the plugin. It can't be done out of the box, you would need a new database table for that or alter the existing one for more fields...T wrote:Is there any way of modifying the StaticPage-plugin so that StaticPages can also include CustomFields? Thanks in advance.
Hmm, the problem is that I am an absolute PHP-n00b. I'm just good at editing templates. Any chance of anybody editing the plugin in the near future? Or explaining how I should do this? Thanks again for your answers, I'm a great fan of Serendipity and it's makers.garvinhicking wrote:There would be a way, of using PHP code to enhance the plugin. It can't be done out of the box, you would need a new database table for that or alter the existing one for more fields...
I'm trying to use Serendipity to build a reference-site, and I need the tree-view features of StaticPages, the option to stack them in sub-categories, the 'crumbs'-thingy, the pretty URL's...garvinhicking wrote:Is there a specific reason why you absolutely need your staticpages to have customfields, instead of using the entries of serendipity with their existing customfield features?
Ah, okay. And what do you need the custom fields for? Maybe you can instead use some other means to display distinct information within the body?I'm trying to use Serendipity to build a reference-site, and I need the tree-view features of StaticPages, the option to stack them in sub-categories, the 'crumbs'-thingy, the pretty URL's...
OK, here's an example: I want to create a page that has info on a particular book. Now I want to make a sort of 'infoblock' at the upper right side of each page, which gives the reader at a glance the author, year of publication, front-cover image, etc.garvinhicking wrote:Ah, okay. And what do you need the custom fields for? Maybe you can instead use some other means to display distinct information within the body?
What you could do is to create a simply Smarty function, and use the "Markup: Smarty" plugin.Instead of having to copy/paste the same HTML over and over into each StaticPage, I wanted to use CustomFields so I could simply enter author, year etc. in the StaticPage-form. The HTML for the infoblock could than be pasted into the SP-template, with CustomField-variables for the info itself.
Code: Select all
{printBook id='ISBN-12312-2213'}
This is my book discussion ....