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) |
RE: I18N Special Pages - Angryboy - 2013-07-30 If you don't mind a rather makeshift solution, you can modify Special Pages to allow for DateTime-Local input fields (assuming that you use Google Chrome, Safari or Opera). How-to - Edit the file i18n_specialpages/conf_edit.php - go to line 565, which should have: PHP Code: <option value="textfull" <?php echo @$def['type']=='textfull' ? 'selected="selected"' : ''; ?> ><?php i18n('i18n_specialpages/LONG_TEXT_FIELD'); ?></option> And replace it with the following: PHP Code: <option value="textfull" <?php echo @$def['type']=='textfull' ? 'selected="selected"' : ''; ?> ><?php i18n('i18n_specialpages/LONG_TEXT_FIELD'); ?></option> - Save, then go to i18n_specialpages/edit.php and go to line 53 and replace: PHP Code: case 'textfull': // draw a full width TextBox With: PHP Code: case 'textfull': // draw a full width TextBox And save. Result (for a special field with the newly created 'date' type and label 'Date') You would still need to format the output (if you are displaying it on the page) using php functions though (namely strtotime to make it a UNIX timestamp and date to do the formatting). I should make it clear that this is a hack more than anything (and not a rigorously tested one), and is really here as an example/model for further refinement (ideally by the plugin author). RE: I18N Special Pages - Carlos - 2013-07-30 (2013-07-30, 08:46:31)blackeye Wrote: I'm using Special Pages plugin for news and I wonder, if there is a way how to create a field with a properties of a date. I need to have this date field editable by client, so I can't use creDate or pubDate. You may use pubDate, with the (very simple) pubDateFix plugin. RE: I18N Special Pages - blackeye - 2013-07-31 (2013-07-30, 16:07:28)Carlos Wrote:(2013-07-30, 08:46:31)blackeye Wrote: I'm using Special Pages plugin for news and I wonder, if there is a way how to create a field with a properties of a date. I need to have this date field editable by client, so I can't use creDate or pubDate. Excelent! This is exactly what I was looking for. The only thing that bothers me now is, that it shows editable date on all the pages, not exclusively on special news pages. But I can live with it for now. Thanks RE: I18N Special Pages - nnk - 2013-07-31 Hello everybody! Two questions: 1. Any suggestion to rearrange special pages ? I tried dragging them in Navigation structure, then saved. But they're unarranged in frontend ! 2. Is possible to customize the slug of special pages with the page title too...or only strftime functions are allowed? Thank you in advance ;-) RE: I18N Special Pages - Angryboy - 2013-08-01 1 - If you want to arrange by menu order, set the order parameter to menuOrder (+menuOrder for ascending, -menuOrder for descending). 2 - Leave the "Custom URL (Slug)" field empty in that special page's settings to have custom slugs for each page. If you are definiting the slugs yourself, then chances are they'll be unique enough not to need timestamps to be distinguished from each other. There currently isn't an option to have both a dynamically generated timestamp and a custom slug. RE: I18N Special Pages - morvy - 2013-08-01 (2013-08-01, 01:27:15)Angryboy Wrote: 1 - If you want to arrange by menu order, set the order parameter to menuOrder (+menuOrder for ascending, -menuOrder for descending). that looks good, but doesn't work for me, but I use php function to list it $results = return_i18n_search_results($tags="_special_".$args[0], $order=null); what should I change please ? RE: I18N Special Pages - Angryboy - 2013-08-01 PHP Code: $results = return_i18n_search_results($tags="_special_".$args[0], $words=null, $first=0, $max=10, $order='+menuOrder', $lang=null); RE: I18N Special Pages - mvlcek - 2013-08-01 (2013-08-01, 03:11:21)Angryboy Wrote: Thank you very much for answering questions about my plugins, @Angryboy :-) FYI: The function definitions on my web site are copied directly from the code and specify parameter names (and default values). When calling the functions, only the order of the parameters is relevant. Using $xxx= is not necessary and might even cause problems in your template, if you use a variable $xxx in your template. Just call the function with: PHP Code: $results = return_i18n_search_results("_special_".$args[0], null, 0, 10, '+menuOrder'); RE: I18N Special Pages - Angryboy - 2013-08-01 (2013-08-01, 03:51:07)mvlcek Wrote:(2013-08-01, 03:11:21)Angryboy Wrote: No problem. Just keeping being awesome. (On the parameter point: understood; the variables were kept in there for clarity and laziness in order to save explaining what each individual parameter is) RE: I18N Special Pages - morvy - 2013-08-07 guys, I swear that '+menuOrder' was only thing that I didn't try of course it's working perfectly, thanks RE: I18N Special Pages - Oleg06 - 2013-08-11 is it possible to do something to not display a tag <li> with empty fields? Code: <ul class="slides"> RE: I18N Special Pages - Angryboy - 2013-08-11 PHP Code: <?php $slides = array('gall1', 'gall2', 'gall3', 'gall4'); ?> The above takes the slide names as an array, then loops through each name, only outputting the <li> tags if the special field with that name isn't empty. You can add as many gallery names to the array as you want (assuming that the special field for it is filled). RE: I18N Special Pages - Oleg06 - 2013-08-11 reason does not work RE: I18N Special Pages - Carlos - 2013-08-11 Try changing Code: (!empty(return_special_field($slide))) Code: (return_special_field($slide)) RE: I18N Special Pages - Angryboy - 2013-08-11 And if that doesn't work, try Code: (return_special_field($slide) != '') RE: I18N Special Pages - Oleg06 - 2013-08-11 Big, big Russian SPASIBO RE: I18N Special Pages - Oleg06 - 2013-08-19 is it possible to attach "a multiline text field" counter? so that the user did not enter a little more than the number of characters Code: Meta Description: 155 characters remaining RE: I18N Special Pages - sarnaiz - 2013-08-22 [attachment=260] Wondering if I can have two instances of special pages being pulled into a page? I have a page that will have a 4 column layout. I want to have one column with news items 1-4 and the next column with items 4-8 for example. If yes, how would I write this? I am using the code below in another installation of GS and I'm not sure how to or even *IF* I could get the code to pull in the first few items and then continue the next items in the second column. Similar to a newspaper layout. (% searchresults tags:news numWords:25 order:reverseurl %) Thank you for any help you can offer. RE: I18N Special Pages - sarnaiz - 2013-08-22 Controlling Sort Order I'm wondering if I might be able to control the sort order or display of special pages and how if I am not wanting to use alpha or chronological order? I have a special page set up that is a board of director member page with a photo and contact details. I need to list the pages in order of importance-President first, VP next, Secretary next, etc. when pulling them into the display page. Could I add some kind of field or tag to a page to assign importance and control the sort order that way? Thank you for any help you can provide. RE: I18N Special Pages - sarnaiz - 2013-08-22 (2013-08-22, 14:08:31)sarnaiz Wrote: Controlling Sort Order After reading through some of the posts here I'm thinking menu order is what I was looking for to control the sort order. RE: I18N Special Pages - srsdesign - 2013-09-16 Hi all, Apologies if this is answered somewhere else just that I can't find it. I have created a website using Special Pages to create news items. The site itself is in English and Russian, the english side seems to work fine, however, on the russian side news articles show in both english and russian on the home page. So the question is how can I resolve this? The site is : www.stuffid.com Many thanks for any help. RE: I18N Special Pages - mvlcek - 2013-09-16 (2013-09-16, 21:28:53)srsdesign Wrote: I have created a website using Special Pages to create news items. The site itself is in English and Russian, the english side seems to work fine, however, on the russian side news articles show in both english and russian on the home page. So the question is how can I resolve this? Use (% searchresults ... lang=ru %) RE: I18N Special Pages - srsdesign - 2013-09-16 (2013-09-16, 21:50:22)mvlcek Wrote:(2013-09-16, 21:28:53)srsdesign Wrote: I have created a website using Special Pages to create news items. The site itself is in English and Russian, the english side seems to work fine, however, on the russian side news articles show in both english and russian on the home page. So the question is how can I resolve this? Many thanks for the prompt reply, please excuse my ignorance! I am using the View tab in the special pages so under the ru tab my code looks like this: <div id="left_col"> <?php get_page_content(); ?> </div> <div id="mid_col"> <?php get_special_field('projectimg'); ?> </div> <div id="right_col"> <h3>latest news...</h3> <?php get_i18n_search_results(['tags' => '_special_news', 'numWords' => 0, 'max' => 10, 'order' => 'reverseurl', 'lang'='ru']); ?> </div> I presumed that by adding the lang=ru within this are would work however it doesn't. Regards RE: I18N Special Pages - srsdesign - 2013-09-16 (2013-09-16, 22:27:49)srsdesign Wrote:(2013-09-16, 21:50:22)mvlcek Wrote:(2013-09-16, 21:28:53)srsdesign Wrote: I have created a website using Special Pages to create news items. The site itself is in English and Russian, the english side seems to work fine, however, on the russian side news articles show in both english and russian on the home page. So the question is how can I resolve this? Sorry ignore this my mistake should of been 'lang' => 'ru' ! Works now....thank you! RE: I18N Special Pages - sarnaiz - 2013-09-25 (2013-08-22, 16:24:59)sarnaiz Wrote:(2013-08-22, 14:08:31)sarnaiz Wrote: Controlling Sort Order After digging around more in the forum I have the following in my template: <?php get_i18n_search_results(array('tags'=>'staff','max'=>10,'numWords'=>10,'order'=>'-menuOrder')); ?> I have tried both the + and the - and it does not change the display order. Ideally I would prefer to have the proper syntax for including it in the page rather than the template. I am creating too many templates for this site. (% searchresults tags:bod numWords:25 order:-menuOrder%) This code did not work either. http://dev.pweaveanea.org/index.php?id=pwea-contact-information Thank you for any help you can provide, Sherri |