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 - hameau - 2015-07-06 Do you have one special page per item, or are all items on one page? Are you also using the I18N Navigation and I18N Search plugins? If you have each item on its own page, you can display the list by using the search (for example, search by tag for different sections of your price list). The search results can be ordered the same as the 'menu order' (even if the pages are not in a menu, they can still have a menu order). The menu order is set by drag-&-drop ('Edit Navigation Structure'), which also sets the list display order. RE: I18N Special Pages - Carlos - 2015-07-07 Replying to this post (Russian months issues) @Oleg06 Change this: Code: get_special_field_date(PARAMS); Code: echo str_replace( Note: Replace the word PARAMS by your parameters (field name -"creDate" or "pubDate"-, optional date format) RE: I18N Special Pages - Oleg06 - 2015-07-07 cheers, Carlos, finally solved the problem of Russian users with dates Gallery list with Special Pages - pikku - 2015-07-07 Hi, I posted allready a Reply in the Search Plugin´s Forum to explain my problem http://get-simple.info/forums/showthread.php?tid=1256&pid=51894&highlight=list+of+galleries#pid51894 Unfortunately there was no answer! Maybe the explanation of the problem was to weird , or it was the wrong forum - but I have to mix several plugins. I´m trying to solve my problem with a simplier aproach now, but there is still some coding problem. A problem for me as a non-coder, but for php guys it shouldn´t be a major task: I have several galleries (I18N) and my users will add more. I have a page where I want to list the galleries. To make it easier for the users, I set up "I18N Special Pages" with the "...extras"-Plugin. So in the page config there is no content field, but extra text-fields to type the names of the galleries (witch is also the name of the galleries page). There can be added more alike fields by the user. The field-name is "gallerie". In the view field of the special pages type I´m calling the field name like this to get the galleries titles: Code: <h2><?php get_special_field('gallerie'); ?></h2> To get a link to a gallery with the first thumbnail I had to code: Code: <?php get_i18n_gallery_link('my-gallery-name', But how can I get the above call for the name into the call for a gallery-link!? As I said, I´m no coder, so I messed around a lot with the code, but could not find the right way. Please, if someone is so kind to write me a few lines of nice code with get.. within a get...! Just to be shure, you get me, I right down what I mean, but of course, that´s not correct php anymore: Code: <?php get_i18n_gallery_link('get_special_field('gallerie');', hope you can help me, thanks pikku RE: I18N Special Pages - mvlcek - 2015-07-08 (2015-07-07, 01:54:16)pikku Wrote: But how can I get the above call for the name into the call for a gallery-link!? The following should work: Code: <?php get_i18n_gallery_link(return_special_field('gallerie'), get_special_field will output the content of the field, return_special_field will just return it and make it usable in the gallery call. Of course this assumes that gallery name and slug are identical. RE: I18N Special Pages - MicroCAD - 2015-08-01 Hi, I need help to solve a problem with the search rendering of special pages. I'm using an external class with some arrays to manage static translations in the pages. Everything works well in the pages, but now I would like to use the same translation file in the parent page, where I'm using the get_i18n_search_results to display all the childrens. I'm trying to include the file in the plugin's configuration, in the search tab, but it works only for the first children! If I use require, it works only for the first children, and then breaks the page. If I use require_once, it works only for the first children, don't breaks the page but leaves empty the other children. Some ideas about how solve it? I know that the search tab propose the translations, but these texts are use in 5 different special pages, each one has to be translated in 4 languages. Change it locally would be a nightmare. I'm using special page with extra addons. Thank you soooooo much for any help! RE: I18N Special Pages - Carrara - 2015-08-09 As substiuir the characters || on the other, for example a comma? RE: I18N Special Pages - morvy - 2015-09-30 @mvlcek can you replace & with & for getImage function ? I know it's just small thing, but you know, validators... RE: I18N Special Pages - mvlcek - 2015-10-01 (2015-09-30, 20:48:21)morvy Wrote: @mvlcek can you replace & with & for getImage function ? I know it's just small thing, but you know, validators... I18nSpecialPages::getImage (and return_special_field_image) returns the URL to an image - and the URL has & and not & return_xxx functions return the value as is - you have to do the encoding, if needed. Thus you can use the result to do something in PHP like output the plain URL to a log; if you use the result of this method to output the URL on your page, you must wrap it with htmlspecialchars(...). Or use get_special_field_image, which output the complete link. RE: I18N Special Pages - morvy - 2015-10-01 Maybe I wrongly expressed my idea .. I just checked the site with w3 validator and got error because image thumbnail had "&" instead of "&" in the url, so yes, I fixed it, but I can't find any other use where simple & is expected so I thought that setting it to "&" as default would be fine RE: I18N Special Pages - flanders - 2015-10-08 Hi I'm using this plugin but it doesn't work! I use the 3.3.7 version in local pc and I don't see errors in the log file. edit : SOLVED ! I had changed in gsconfig.php define('GSEDITORTOOL', 'full'); then I comment it #define('GSEDITORTOOL', 'full'); now I'm working. RE: I18N Special Pages - Carlos - 2015-10-09 Try with: Code: define('GSEDITORTOOL', 'Full'); Note the uppercase F in 'Full'. RE: I18N Special Pages - 0zz - 2015-10-13 Is there a solution to randomly select certain number of search results? So, let's say I have 20 items with tag "smartphone" created via Special Pages and I want to show only 5 random on a page, so that I will get different items displayed every time page reloads... What would be the best way to make it? Thank you! RE: I18N Special Pages - morvy - 2015-10-13 search result returns array, so you can shuffle its content and shrink array to 5 elements, var_dump/print_r functions can be very handy here RE: I18N Special Pages - 0zz - 2015-10-14 Thank you, morvy, but PHP is not my best talent (( Not at all, in fact. could you, please, extend your suggestion to working function? )) Thank you! RE: I18N Special Pages - Tyblitz - 2015-10-16 (2015-10-14, 02:57:08)0zz Wrote: Thank you, morvy, but PHP is not my best talent (( Not at all, in fact. Hi 0zz, It is somewhat weird to display totally random results, you would more often display, eg. the latest five. Anyway here's how you would do it with PHP (comments for explanation). PHP Code: <?php As for var_dump and print_r ; these are debug functions which will print the output of a PHP variable on the page (so you can preview your results before doing something with them).For example, in the codeblock above, you could have done: PHP Code: <?php var_dump($searchresults['results']); ?> And it would show you the results returned by i18n_search in PHP-format (arrays and objects). RE: I18N Special Pages - 0zz - 2015-10-16 Hi, Tyblitz! This looks like "WOW!" Thank you for your time and really throrought work and explanations! Random display is a need, when, for example, you want to display similar goods/items under a selected item. Or, when you have many articles, let's say about celebrities or animals, and you want to display them randomly, so that every time visitor reloads page, he gets new anonses displayed. Could you please, give more information about how to use other options for displaying articles? Like use numWords, lang and showPaging options? Sorry, this must be easy, but I am not familiar with naitive PHP even (( RE: I18N Special Pages - Tyblitz - 2015-10-17 The $lang parameter filters out articles in another language. If you had 5 articles with the tag 'smartphone', from which 2 in French, and 3 in English, and you set $lang to 'en', you would get 3 results.The $numWords parameter defines how long excerpts are in amount of words. You can achieve the same in my example if you did (in the foreach loop):PHP Code: <?php echo $searchresults['results'][$index]->getExcerpt($searchresults['results'][$index]->content, 50); ?> $showPaging is a parameter for the get_ function, so you can't use it in the example I provided. Read more about those parameters in the docs.
RE: I18N Special Pages - 0zz - 2015-10-17 Thank you, Tyblitz so much! I know, of course, about parameters and what they are for, but I had difficulties with applying them in your suggested php code above. Now it is more or less clear, however I am still trying to figure out how to display articles in the way I need. Output display settings in SpecialPages plugin do not work, obviously.. Also, I may need to add some html tags to wrap the search-results, since with your code only pure text is displayed or paragraphs if i set '1p' as an excerpt.. RE: I18N Special Pages - Tyblitz - 2015-10-17 Hey 0zz, The requirement to display completely random posts cannot be fulfilled with the get_ function; that's why you need to do some additional processing, and cannot use all its handy parameters. The code I provided is intended to work as a replacement for the 'search' type of display (but in a theme template, not in the special page fields, in a case like the example you provided about random linked articles).You can completely customize the foreach function, eg: PHP Code: <?php Quote:Output display settings in SpecialPages plugin do not work, obviously.. What do you mean? Of course they work, eg in a special page View tab: PHP Code: <?php RE: I18N Special Pages - 0zz - 2015-10-18 Now it makes so much more sense, Tyblitz! I just wasn't able to figure out how to apply additional html+styling for the results.. Thank you, kind man! RE: I18N Special Pages - Oleg06 - 2015-10-23 is it possible in the file conf_edit.php in line 40 add _ for name using checkbox as a tag. RE: I18N Special Pages - datiswous - 2015-12-14 Idea:
RE: I18N Special Pages - simba - 2015-12-29 I wanted to auto get thumbs to my custom field "image". So with a little help from a friend I've devised something that works quite well. Im dropping it here, it may come useful. Also - is there a simpler way to do this? PHP Code: <?php RE: I18N Special Pages - mvlcek - 2015-12-30 (2015-12-29, 21:36:43)simba Wrote: I wanted to auto get thumbs to my custom field "image". So with a little help from a friend I've devised something that works quite well. Im dropping it here, it may come useful. Also - is there a simpler way to do this? You can use return_special_field_image('image', 120, 90, false) to get the link or get_special_field_image('image', 'My image description', 120, 90, false) to output the whole img tag for a scaled version (thumbnail) in size 120x80 of the image in field 'image'. The scaled version is created when first accessed. |