Custom Fields like in WordPress
|
May 2, 2008 21:59
351 posts
|
Custom Fields like WordPress has would be a great way to save meta-data for the content that you could then use in the layout. What I would use it for is to set an id for the body tag, set header images for different sections of the site and so on. Other people will have different uses. See WordPress: http://codex.wordpress.org/Using_Custom_Fields Can somebody make it happen? Please :) |
|
May 3, 2008 05:04
963 posts
|
I think (I'm not sure!) you could use the "Tag" field in the current "Metadata" (beside the "Page Title" tab in the admin view of each page) for this purpose. If you look at the mySQL table layout, you will see that there is a "page_tag" table which joins the value of a given tag with a given page. We could probably use a bit of documentation on how to use this (!!!), but at least the basics of this functionality are already in the system. It seems. I hope. :) |
|
May 3, 2008 11:51
277 posts
|
I think I have a solution for this. If you see, you can consider the content parts the same as custom fields. This CMS is very powerful.Go and choose the page you want to edit and add these 2 parts: keywords and description. Now all you have to do is insert this lines of code in the <head> section of your layout. <code> <?php if ($this->hasContent('description')): ?> <meta name="description" content="<?php echo $this->content('description'); ?>"> <?php endif; ?> <?php if ($this->hasContent('keywords')): ?> <meta name="keywords" content="<?php echo $this->content('keywords'); ?>"> <?php endif; ?> </code> It should work. A exemple is here : <http://frog.bebliuc.ro> . Just see the source. |
|
May 3, 2008 11:53
277 posts
|
Don't forget to eliminate the <code> and </code> tags. I hate markdown. |
|
May 3, 2008 12:32
963 posts
|
@Bdesign: "I hate markdown." :) Give it time! You'll love it soon! :)) And nice description of how to use "description" and "keywords". It is a good use of what is described in the docs here -- so you can add anything, and do quite a lot with it! Maybe even better than WordPress's "custom fields"! |
|
May 3, 2008 13:06
351 posts
|
Geez, i thought that stuff was being automatically inserted into the layout as meta description and meta keywords. Thanks for the heads up! I can see now how we can access that particular meta information in the layout, but how do we get key-value pairs? |
|
May 3, 2008 13:22
351 posts
|
Bdesign, The code you posted doesn't work for me. First of all, I don't think there's actually a description field. I don't see it on the form and I don't see any column in the page table. And if ($this->hasContent('keywords')) must be returning false because nothing is output. I looked at the source of your page and it has no meta description or keywords :) So basically that's another reason to either have the option of custom fields or create a bunch of extra fields for this purpose on the page's metadata tab. We need to have unique keywords and descriptions for each page. This is a basic SEO thing. |
|
May 3, 2008 13:32
963 posts
|
@ricks - Beside the "Body" tab when you're editing a page, you see the green "+" and red "-" icons off to the right? You click on that and add any "tab" (= page part) you like, and enter whatever data you like. The tab could be called "keywords" or "book-titles" or "anything", and you can call it with I'm not sure where you want to display this! Or exactly what you want to do with it. But the PHP code has to got in an unfiltered place, I guess (snippet/layout)? |
|
May 3, 2008 13:32
351 posts
|
David, The tags appear to be just tags for basic content organization. The documentation page you linked to doesn't show how to add meta information! |
|
May 3, 2008 13:38
963 posts
|
Hi again! (We should be on IM!) Have a look at the source of this page. I added a "tab" called "description" to that article, and displayed it using Bdesign's code above. See the secret message! ;) |
|
May 3, 2008 13:43
351 posts
|
HOW DID YOU DO THAT??? |
|
May 3, 2008 13:46
351 posts
|
Okay, I see the Tab control now! Thanks!!! |
|
May 3, 2008 13:47
277 posts
|
Hey, not fair! What did David that I didn't? Just kiddin' . |
|
May 3, 2008 13:50
351 posts
|
Bdesign, you didn't tell me about the Tab control!! Thank you both though, Frog does have custom fields then. Friggin awesome. |
|
May 3, 2008 13:58
277 posts
|
I didn't told you, but I said about the part control, and you add content parts using Tab control, I supposed you already know about it :D . I know, Frog is very flexible. |
|
May 3, 2008 14:05
351 posts
|
Oh yeah i didn't know that 'part' meant something specific in Frog. I thought you were just talking about different parts of stuff. From now on we should probably use capitalized Part to avoid confusion! So where's the Frog IRC channel? |
|
May 26, 2008 13:34
7 posts
|
Ok, and, it is possible to have fixed parts? Example: I would like to include a different description to each page, but I would like to have the Tab "description" already there when creating a new page. Creating the same tab everytime seams illogical to me. Is there a way?Aleph Ozuas www.ciberarte.com.br |
|
May 27, 2008 10:45
7 posts
|
hey people, this topic is dead? its better to open a new one? |
|
Oct 3, 2008 16:54
51 posts
|
Oh my god. I too hadn’t noticed those … Frog might be small, but man it packs alot. Super thanks for the heads up on that. |
|
Oct 3, 2008 17:23
963 posts
|
Yep, BlueFrog, those custom page-parts are brilliant. In case you haven’t seen it, there is some documentation available. “Inheritance” from parent to child of these “parts” is very useful (see the note about this in the doc). I have started using a (By the way – once you have a child page set up a certain way, its siblings will get the same page-part/tab selections as the existing pages on that level. Hope that makes sense! It means you don’t need to recreate your page-parts every time within a given branch of your site.) Lots you can do with these things! |
|
Dec 27, 2008 18:16
10 posts
|
I’m with aozuas – is there a way to edit the page template to include certain custom fields that are used often? or maybe a field that is checkboxes instead of straight text (to avoid misspelling)? Is there a way to sort pages based on a common custom field they share? (For instance – show on a page the content from all pages with the tag “News”)… I’m sure this is already being done…just kind of foggy for me. |