CustomField for Static Pages?
CustomField for Static Pages?
Is there any way of modifying the StaticPage-plugin so that StaticPages can also include CustomFields? Thanks in advance.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: CustomField for Static Pages?
Hi!
Best regards,
Garvin
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.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: CustomField for Static Pages?
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...
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: CustomField for Static Pages?
Hi!
Okay, I'm afraid that this would be too hard then for you to do. Maybe someone picks up this thread here and feels challenged to have a try?
I know the original author of the staticpage plugin was doing work on Staticpages2 with more flexibility, but I don't know the status of his efforts.
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?
Best regards,
Garvin
Okay, I'm afraid that this would be too hard then for you to do. Maybe someone picks up this thread here and feels challenged to have a try?
I know the original author of the staticpage plugin was doing work on Staticpages2 with more flexibility, but I don't know the status of his efforts.
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?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: CustomField for Static Pages?
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?
Anyway, many thanks for your quick responses & I hope somebody indeed picks up on this thread.
Regards,
T
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: CustomField for Static Pages?
Hi!
Best regards,
Garvin
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...
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: CustomField for Static Pages?
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?
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.
I hope this clarifies things.
Regards,
T
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: CustomField for Static Pages?
Hi!
This way you can enter something like this into your static page body:
Now, the smarty printBook function could take care of fetching Amazon resources and printing them in a nice table layout.
Would that be something that could help? Adding the custom smarty function is not sooo terribly hard to newbies as well (http://www.s9y.org/78.html#A4)
The downside is that it's all kept in the 'body' entry and not in nice seperate fields...but maybe better than having nothing at all?
Best regards,
Garvin
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.
This way you can enter something like this into your static page body:
Code: Select all
{printBook id='ISBN-12312-2213'}
This is my book discussion ....
Would that be something that could help? Adding the custom smarty function is not sooo terribly hard to newbies as well (http://www.s9y.org/78.html#A4)
The downside is that it's all kept in the 'body' entry and not in nice seperate fields...but maybe better than having nothing at all?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: CustomField for Static Pages?
OK, I'm going to try it soon! That's indeed better than having nothing at all. Still hope somebody picks up on the thread...
Thanks + best regards,
T
Thanks + best regards,
T