I18N Special Pages - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13) +--- Thread: I18N Special Pages (/showthread.php?tid=2747) |
I18N Special Pages - mvlcek - 2012-02-12 The I18N Special Pages plugin allows you to define types of pages with custom fields, customized behaviour and customized display. Together with the I18N Search plugin you can create (fully searchable)
Features:
INSTALLATION Download the plugin from here and unzip it to the plugins directory of your GetSimple installation. (Make sure you unzip/copy all files including the .htaccess files, which might be hidden on your computer) For an optimum experience you should also install (use the latest versions) USAGE Go to the Plugins/Configure I18N Special Pages of your GetSimple administration and configure your special pages. You can start by using one of the supplied templates or download one of the templates supplied by other users.
Once you have finished defining a special page type, you can create a page of this type by going to Pages/Create new Special Page. You can list special pages either with all other pages in Pages/View all Pages or in Pages/View all Special Pages. Using additional fields: Use the following functions in your template or in the view/search tabs of the special page configuration: Code: get_special_field($name, $default='', $isHTML=true) If you set $isHTML to false, special characters are encoded (with htmlspecialchars()). For $format see the PHP function strftime. With I18N Search installed: All content and all custom fields that are enabled for indexing, will be searched with a normal search. To search for special pages, e.g. products, create a page with: Code: (% searchform addtags=_special_product %) You can also use the following functions in your template or search tab of the special page configuration: Code: get_special_field_excerpt($name, $length) $length can be a positive number for the number of words or a positive number followed by 'p' or 'pm' for the number of paragraphs (pm: add a <p>...</p> if there is more) or a negative number for the whole content. I18N Special Pages - yurifanboy - 2012-02-12 This is great. However, one suggestion after testing it out would be: for a blog page type, having all of the blog posts listed on the standard I18N view all pages seems to be counterproductive as a blog with let's say 100 posts would start to get really long. It makes sense to list the blog posts under view special pages > blog. I18N Special Pages - shawn_a - 2012-02-12 Doesn't fail gracefully if i8n_common is missing. 500 error. Have to install search. I18N Special Pages - KBear - 2012-02-12 Added some content to "Set default page content..." , and the content did not show up in the new special page. Tags & Keywords field did show loaded content in the new special page. I18N Special Pages - mvlcek - 2012-02-12 @KBear and @shawn_a: Corrected in I18N Special Pages version 0.7.1. Thanks for testing! I18N Special Pages - mvlcek - 2012-02-12 yurifanboy Wrote:This is great. However, one suggestion after testing it out would be: for a blog page type, having all of the blog posts listed on the standard I18N view all pages seems to be counterproductive as a blog with let's say 100 posts would start to get really long. It makes sense to list the blog posts under view special pages > blog. Yes, I know. There are some disadvantages of having news or blog entries as pages. However, the plugin llists the blog posts under View all Special Pages/Blog and if you have all blog posts under one parent and use the hierarchical view of the pages view of the I18N plugin, you can close this parent and save your settings. Then you won't see the blog posts in the pages view. That's the reason I recommend to also install the I18N plugin. I18N Special Pages - jkob - 2012-02-13 I'm probably missing something very obvious out, but I cannot figure out how to insert the custom fields into my template. Using the method from the I18N Custom Fields plugin doesnt seem to work (i.e. <?php get_custom_field('nameofthefield'); ?> ) I18N Special Pages - mvlcek - 2012-02-13 jkob Wrote:I'm probably missing something very obvious out, but I cannot figure out how to insert the custom fields into my template. Using the method from the I18N Custom Fields plugin doesnt seem to work (i.e. <?php get_custom_field('nameofthefield'); ?> ) I have updated the description in the first post of this thread and on my web site: get_special_field, return_special_field, etc. I18N Special Pages - jkob - 2012-02-13 Thank you for a very quick reply Still cant get it to work - it will output $default if I add something to that, but not $name. $name is just the name of the field, right? I dont have to use the name of the Special Page Type for anything? I18N Special Pages - mvlcek - 2012-02-13 jkob Wrote:Thank you for a very quick reply Yes. E.g. if you have a field named myfield, you can use Code: <?php get_special_field('myfield'); ?> I18N Special Pages - jkob - 2012-02-13 Aaaahh great! It works now - my mistake was to add <?php get_special_field('myfield'); ?> directly in the template.php file, when I used the View tab instead it worked. Fantastic plugin, thank you I18N Special Pages - mvlcek - 2012-02-13 jkob Wrote:Aaaahh great! It works now - my mistake was to add <?php get_special_field('myfield'); ?> directly in the template.php file, when I used the View tab instead it worked. Fine that it works for you now. But it should also work directly in the template, if the current page is a "special" page with this field set. I18N Special Pages - KBear - 2012-02-13 mvlcek Wrote:...Thanks for testing! Thanks also, loads a preformated layout well. I'm also confused with the "input fields" and what to do with them. I18N Special Pages - mvlcek - 2012-02-13 KBear Wrote:I'm also confused with the "input fields" and what to do with them. The fields are additional input fields, when editing a page, so that you can enter your information in a structured way. You will see them when you click on "Page Options", when you create/edit a page. I18N Special Pages - Angryboy - 2012-02-17 I am terribly excited about this plugin, because it is the final nail that your news plugin needs to be flawless (since this eliminates some of the manual labour that may put off new users). I don't see a problem with it at the moment, so I only have one question. Is there a way that I can migrate my current news pages into this format? I have a great number of pages that I've spent hours correcting dates and times for and I'd hate to lose all of the time formatting I've needed to do. Is the only way of doing so to remake the pages under 'Special Pages' and edit the xml files on the back-end to fix the 'date created' and 'published' dates? ---edit--- just realised that I didn't make the nature of my news pages clear - they are just regular pages with utilising custom fields, all viewed through your search plugin. ---edit #2--- Figured out how to do it. For anyone who needs to... Using the file manager of your web provider, open the .xml file of the page that you wish to change from 'regular' to 'special'. Find the following: Code: <meta> And insert after it: Code: [CDATA[_special_SPECIALNAMETYPE, SPECIALNAMETYPE]] Where SPECIALNAMETYPE is the name of the type of the special page you've created, e.g. news. It should now read: Code: <meta>[CDATA[_special_SPECIALNAMETYPE, SPECIALNAMETYPE]] Then find: Code: </meta> and paste after it: Code: <special>SPECIALNAMETYPE</special> So that it reads: Code: </meta><special>SPECIALNAMETYPE</special> Where SPECIALNAMETYPE means what was previously said. Save the xml file and it should now be a Special page. Finally, edit the page in GetSimple, find the meta tags and delete the one with the square brackets on it and resave the page. Everything should then be sorted. It may be a lengthy manual process for those with many news items or articles, but that's all that's needed to make an already existing page 'special'. I18N Special Pages - mvlcek - 2012-02-17 Just wantet to answer, but you were faster :-) Some comments:
If you edit the meta tag, it should read <meta>_special_NAME, ...</meta> or <meta><![CDATA[_special_NAME, ...]]></meta>. And you should remove your custom fields from the I18N Custom Fields plugin and add them to the special page type. I18N Special Pages - mvlcek - 2012-02-17 I18N Special Pages version 0.7.2:
I18N Special Pages - Angryboy - 2012-02-17 Thanks for the speedy reply I shall definitely do that and update everything on my site. This calls for a Version 3 for the news plugin tutorial y'know :-P Stay awesome, mvlcek. I18N Special Pages - alienee2 - 2012-02-17 I'm very excited about this plugin; this will solve many issues with custom content display; i have one question regarding the URLs; is there any way to be able to control the page slug for special pages? I installed the first version and noticed that the page slugs had to have a date suffix; but if i were creating something like a discography, it would be better to have a custom pages slug... and also i wanted to check to see about displaying an image field on the results page.... thanks, marc I18N Special Pages - mvlcek - 2012-02-17 alienee2 Wrote:I installed the first version and noticed that the page slugs had to have a date suffix; but if i were creating something like a discography, it would be better to have a custom pages slug... They don't have to: "Here you can enter a ..." Just leave the slug field empty in the configuration and set it when you create the page. I18N Special Pages - Angryboy - 2012-02-17 On the configuration of the discography's special page (Plugins -> Configure I18N Special Pages -> discography), simply delete what is in the Slug/URL field completely and save. Thereafter, when you create and edit special pages under discography, you'll be asked to define the Slug/URL yourself, as with any normal page. It looks like the only possible fault with this plugin is that you can't have a combination of the pre-defined prefix/suffix and your own custom slugs. It's either all predefined or all custom. Some might like it so that the field can take a form similar to the following: Code: news-%Y-%m-%d-{pageslug} And page slug is the name that they define themselves. That way they can have the date always pre-defined, but ensure that the full slug always includes any additional titles that they may want, e.g: Code: news-2012-02-17-i18n-special-pages-update Or in alienee2's case: Code: %Y-%m-%d-{pageslug} Where the custom slug includes the artist's name, year and album, leading to Code: 2012-02-17-artist-year-album Or something. --edit-- took too long editing my post to see that mvlcek had posted already xD --edit-- My news items aren't showing: http://spritingonawhim.net.tc/blog/ On that page I have Code: (% searchresults addtags=_special_news %) So is there something I am missing? --edit-- fixed it by changing addtags to just tags. I18N Special Pages - Angryboy - 2012-02-18 Besides ticking 'INDEX', is there anything else that is needed for a special field to be indexed by a regular search? I can't seem to get my special pages to index any special fields. I ask this because I'm writing up the tutorial now and there is a certain feature that I want to show that necessitates said fields being searchable. I18N Special Pages - mvlcek - 2012-02-18 I18N Special Pages version 0.7.3:
Edit: if you downloaded this version before this edit, redownload it. I18N Special Pages - Angryboy - 2012-02-19 Working fine (tested in GS 3.1). Thanks again for the quick and efficient response. :-) I18N Special Pages - mvlcek - 2012-02-19 I18N Special Pages version 0.7.4:
|