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 - mvlcek - 2015-01-21 (2015-01-21, 08:50:32)Tyblitz Wrote: I'm a great supporter of i18n but for a PHP noob like me the documentation on mvlcek.bplaced.net didn't really suffice, especially not about the output of the return_i18n_menu_data function. Yes, the description is for programmers and rather short ;-) You can always use the PHP function print_r to output a variable, e.g. the returned structure of return_i18n_menu_data. (2015-01-21, 08:50:32)Tyblitz Wrote: So after a day of PHP research and fiddling with i18n plugins in GetSimple, I wrote a more comprehensive piece of documentation here: http://codepen.io/Webketje/full/VYbxmy/. Feel free to check it out (especially Martin, as you may point me to errors, if any). Nice work. However, the $slug need not be the current page: there are use cases where this is not the case, e.g. http://mvlcek.bplaced.net/get-simple/multi-level-navigation/nav-multiple. You could also use custom rendering and not output the link for items with child pages, e.g. Code: <li class="<?php echo $item->classes; ?>"> RE: I18N Special Pages - sarnaiz - 2015-02-05 NEED TO ADD MENU ORDER Hi Martin, I need to add order:menuOrder to the component code or my search results display code but don't know the proper syntax to make it work. Also, not sure which place is the right place to add it - in the component or in the search results code: My component code: PHP Code: <?php get_i18n_search_results(array('tags'=>'_special-grocery','HEADER'=>null)); ?> My search results code: PHP Code: <h3 class="search-entry-title"> I've looked through things, but don't see an example of what to use and I'm not a programmer. :-) The page is starting to shape up nicely thanks to help I've gotten here! http://medbake.com/groceries/ Thank you for your help. RE: I18N Special Pages - sarnaiz - 2015-02-12 (2015-02-05, 16:11:17)sarnaiz Wrote: NEED TO ADD MENU ORDER Please let me know if I have posted this in the wrong place. I thought it was pertaining to special pages rather than search since I am working in the search results for special pages. RE: I18N Special Pages - sarnaiz - 2015-02-12 (2015-02-12, 17:48:32)sarnaiz Wrote: [quote='sarnaiz' pid='49614' dateline='1423116677'] SOLVED PHP Code: <?php get_i18n_search_results(array('tags'=>'_special-grocery','order'=>'menuorder','HEADER'=>null)); ?> I was able to figure out the syntax to add it to the component code and also I went back and reviewed the code on a site Martin had helped me with. I realized I had not added all special pages to the menu. I did that and then reviewed my code again and tried code above and it worked. RE: I18N Special Pages - bensayers - 2015-02-16 Hi Martin, I need to check to see if a special field is empty - if it's empty, I want to hide it. I know how to do this in my template using the code below but can you show me how to accomplish this using a component? PHP Code: <?php if (return_special_field('specialimg') != "") { ?><div class="entry-thumb"> Thanks again! RE: I18N Special Pages - Carlos - 2015-02-16 Code: <?php if (return_special_field('specialimg', "") != "") ... RE: I18N Special Pages - bensayers - 2015-02-17 (2015-02-16, 17:15:13)Carlos Wrote: Thanks for the quick reply Carlos, but I'm looking for the code to do this in a component, not in my template. Do you know how to do that? RE: I18N Special Pages - Carlos - 2015-02-17 Oh sorry, I read too quickly (well I almost didn't read) and thought it was another issue. Doesn't it work if you simply put your code in a component? RE: I18N Special Pages - bensayers - 2015-02-17 (2015-02-17, 01:38:46)Carlos Wrote: Oh sorry, I read too quickly (well I almost didn't read) and thought it was another issue. No problem, Carlos. From my experience the template code looks like this: PHP Code: <?php get_special_field('link','',false); ?> And component code looks like this: PHP Code: <?php echo $item->link; ?> I've tried using the template code below in a component and it doesn't work so I just need to know how to convert this to work inside a component - thanks! PHP Code: <?php if (return_special_field('specialimg') != "") { ?><div class="entry-thumb"> RE: I18N Special Pages - Carlos - 2015-02-17 So I suppose you're using I18N Search to call the component. It may be something like this (not tested) Code: <?php if (!empty($item->specialimg)) { ?><div class="entry-thumb"> RE: I18N Special Pages - bensayers - 2015-02-17 (2015-02-17, 03:07:08)Carlos Wrote: So I suppose you're using I18N Search to call the component. Yes, I'm using the i18n Search plugin to call the component: PHP Code: <?php get_i18n_search_results(array('tags'=>'_special_junews','max'=>3,'component'=>'jusidebarnews','order'=>'menuOrder','numWords'=>30,'showPaging' => 1,'HEADER'=>null,'i18n'=>0)); ?> The code you provided produces the following error: Fatal error: Call to undefined function __get() in /home/clientfolder/public_html/plugins/i18n_search/searcher.class.php on line 115 RE: I18N Special Pages - Carlos - 2015-02-17 Oops. Well I don't know if there's some way to generate the thumbnail other than hardcoding it with .../pic.php?p=... RE: I18N Special Pages - bensayers - 2015-02-17 (2015-02-17, 03:56:16)Carlos Wrote: Oops. Thanks anyway for trying Carlos, hopefully Martin will be able to shed some light. RE: I18N Special Pages - Oleg06 - 2015-02-17 please tell me how to replace this code in the component Code: <?php get_special_field_image('image', 'title', '300', '200'); ?> Code: <img src="<?php echo $item->image; ?>" /> RE: I18N Special Pages - bensayers - 2015-02-17 (2015-02-17, 08:24:30)Oleg06 Wrote: please tell me how to replace this code in the component I use TimThumb to crop images in components and it does a great job: https://code.google.com/p/timthumb/ PHP Code: <img src="/theme/themename/includes/php/timthumb.php?src=<?php echo $item->image; ?>&h=300&w=200&q=80" alt="<?php echo $item->title; ?>" /> RE: I18N Special Pages - Oleg06 - 2015-02-17 Thanks, works great RE: I18N Special Pages - denisnorma - 2015-02-24 Is it possible to make datepicker field? I need to specify the time, date, and year of the concert. I made three field drop-down list, is not comfortable. RE: I18N Special Pages - Carlos - 2015-02-27 (2015-02-17, 03:56:16)Carlos Wrote: Well I don't know if there's some way to generate the thumbnail other than hardcoding it with .../pic.php?p=... This is what I meant: PHP Code: <img src="<?php get_site_url(); ?>plugins/i18n_specialpages/browser/pic.php?p=<?php echo substr($item->image, strpos($item->image, 'data/uploads/')+13); ?>&h=300&w=200&c=1" alt="<?php echo $item->title; ?>" /> That is, using Special Pages' own image resizing script. RE: I18N Special Pages - revotron - 2015-03-07 I don't seem to quite understand the logic of this plugin... If I configure a special page and set up my fields, then the number of input fields for this special page seems to be "hardcoded" to the number of input fields created in the backend and rendered with the code snippets in the template file. For example I want to display two input fields, one image field and one textfield for the image description. After I've created this fields in the admin panel I'll insert something like this in my template file: PHP Code: get_special_field_image('image') PHP Code: get_special_field('description') So the user is only able to insert one image and one description. But how do I solve the problem if this input should be dynamically editable/expandable by a user in the backend? For example: If I want to have four images and four descriptions, I have to create four fields for images and textinputs. But after several weeks my client wants to add another image, so it's five images and descriptions in total instead of the preset four fields. How do I handle this situation? Is this possible with some loop? Or is the number really "hardcoded" and I have to add another field and another snippet in the template each time? I hope you understand my question.. my English got a bit rusty. RE: I18N Special Pages - morvy - 2015-03-07 no, you create a template for this special page and you create search results page (for example) and in search you show all special pages of given type, taking only image and description .. user in backend creates separate page for each image/description RE: I18N Special Pages - revotron - 2015-03-08 To be more precise I want to build a slider with this plugin. The user in the backend can add as many images and descriptions as he likes. Is this even possible if I have to add separate pages for each image? Can you give me some more details about the templates you were talking about, please? Do I have to create a template in the plugin folder (i18n_specialpages > templates)? Where and how do I create a search result page? It seems a bit to inconvenient to me. Maybe there is a better plugin for this situation (repeatable custom fields for images/description in backend, which I can call in my template to build a slider)? I'm new to getsimple CMS... EDIT// Ok.. seems like I got this to work. But it doesn't feel right to create (sub)pages for every new content element and render them via "faked" search results. Moreover the source code of the rendered html is full of class="search-entry" and so on. I just want to have repeatable fields, that I can output in my template without any HTML structure so I can build it by myself for whatever I need those fields. Any suggestions? RE: I18N Special Pages - morvy - 2015-03-08 use i18n gallery plugin instead > http://get-simple.info/extend/plugin/i18n-gallery/160/ RE: I18N Special Pages - revotron - 2015-03-08 (2015-03-08, 01:52:57)morvy Wrote: use i18n gallery plugin instead > http://get-simple.info/extend/plugin/i18n-gallery/160/ This plugin looks promising. I can't use any of the presets, but it looks like I could edit the plugin and create my own template file for it. Hmm… But back to the Special Pages plugin. Is it possible to create repeatable fields or content areas without creating a "faked" search results page? This seems just like a sort of workaround? RE: I18N Special Pages - morvy - 2015-03-09 I've created a component like this (didn't test it) PHP Code: <?php then in a template you call that component .. special page needs only image to be added, as title and content are default and can be used also .. RE: I18N Special Pages - mvlcek - 2015-06-19 I18n Special Pages version 1.3.4:
|