Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N Special Pages
Martin, sometimes the tags appears before the comma (that I drew) http://prntscr.com/aqt61v

gslexx http://get-simple.info/forums/user-24147 advised me to replace the code in line 179 in the file specialpages.class.php on this
Code:
$url .= '?tags='.(!$all && $type ? ' _special_'.urlencode($type) : '').urlencode(str_replace(" ","_",$tag));
the comma disappeared
Reply
Hello,

i haven't found an aswer. Here is my question :

Using i18n-special-pages,

Is it a good or bad practice to use 'getPageContent' method to have a field on every front page ?

More details :

i have a "user profile" (by default) special page with some fields like "mobile" and others, which user can easily change himself.

I want these fields to show up on every front pages, let's say on header or else.

In my theme, When i use This <?php get_special_field('name'); ?> I only have the field shown up on that user page ONLY.

But i want it on every pages.

So, i used this : <?php getPageContent('slug','mobile'); ?> and the trick is done...

Not sure this is the right thing to do... Please enlighten me.

Regards from France
Reply
Oddly behaves plugin. On the main page, the image hit.png is loaded from the folder selected theme, and the rest of the folder from the default theme. Smile
http://demo.getsimplethemes.ru/shop-ru/?...Cart-green
http://demo.getsimplethemes.ru/shop-ru/m...Cart-green
http://demo.getsimplethemes.ru/shop-ru/p...Cart-green

Code is the same everywhere.
Code:
<img class="hit" src="<?php get_theme_url(); ?>/images/hit-<?php get_setting('site_settings','select_color'); ?>.png" alt="Хит продаж" />

Code:
                <?php if ( return_page_slug() == 'index' ) { ?>
                   <div class="item excerpt">
                        <div class="thumbnail-cart-item thumbnail text-center">
               <?php if (return_special_field('hit')=='on') { ?>
                 <img class="hit" src="<?php get_theme_url(); ?>/images/hit-<?php get_setting('site_settings','select_color'); ?>.png" alt="Хит продаж" />
               <?php } ?>
                            <figure class="view view-tenth" itemscope itemtype="http://schema.org/ImageObject">
                                    <?php get_special_field_image('image','' . return_special_field('title') . '', '480', '' . return_setting('shopping_cart','cart_height') . ''); ?>
                                <figcaption class="mask bg-color-second" itemprop="caption">
                                    <a class="litebox info" data-litebox-group="group-your-gallery" data-litebox-text="<?php get_special_field('title','',false); ?>" href="<?php get_special_field('image','',false); ?>" itemprop="contentUrl"><i class="<?php get_setting('shopping_cart','search_class'); ?>"></i></a>
                                </figcaption>
                            </figure>
                            
                            <h3 class="<?php if (return_setting('shopping_cart','cart_height_h3')) { ?>cart-title-height-2 <?php } ?>cart-title font-size-<?php get_setting('shopping_cart','cart_fontsizer'); ?>" itemprop="name"><a href="<?php get_special_field('link','',false); ?>"><?php get_special_field('shorter','',true); ?></a></h3>

                            <?php if (return_special_field('text')) { ?>
                                <p itemprop="cart-description"><?php get_special_field('text','',false); ?></p>
                            <?php } ?>

                            <?php if (return_special_field('discount')) { ?>
                                <p class="cart-price"><span class="title-price"><?php get_setting('shopping_cart','name_price'); ?></span><br><span class="strikeout"> <?php echo number_format(return_special_field('price','',false),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span><br><span class="price"> <?php echo number_format((return_special_field('price','',false) - return_special_field('discount','',false)),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>                
                                <p class="cart-discount"><?php get_setting('shopping_cart','name_discount'); ?><span><?php echo number_format(return_special_field('discount','',false),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>
                            <?php } else { ?>
                                <p class="cart-price"><span class="title-price"><?php get_setting('shopping_cart','name_price'); ?></span><span class="price"> <?php echo number_format(return_special_field('price','',false), 0,'', ' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>
                            <?php } ?>
                            
                            <?php if (return_setting('shopping_cart','use_cart_setting')) { ?>
                                <form action="<?php echo $_SERVER['REQUEST_URI']?>" method="POST" class="form-inline add-form">
                                    <input type="hidden" name="id" value="<?php get_special_field('id','',false); ?>" />
                                    <input type="hidden" name="link" value="<?php get_special_field('link','',false); ?>" />
                                    <input type="hidden" name="name" value="<?php get_special_field('title','',false); ?>" />
                                <?php if (return_special_field('discount')){ ?>
                                    <input type="hidden" name="price" value="<?php echo return_special_field('price','',false) - return_special_field('discount','',false)?>" />
                                <?php } else { ?>
                                    <input type="hidden" name="price" value="<?php get_special_field('price','',false); ?>" />
                                <?php } ?>
                                <?php if (return_special_field('image')) { ?>
                                    <input type="hidden" name="image" value="<?php get_special_field('image','',false); ?>" />
                               <?php } ?>

                              <?php if (return_setting('shopping_cart','use_cart_number')) { ?>
                                    <div class="form-group">
                                        <input class="form-control cart-number" type="number" min="1" max="50" name="quantity" value="1" />
                                    </div>
                              <?php }  else { ?>
                                  <input type="hidden" name="quantity" value="1" />
                              <?php } ?>

                                    <button class="btn btn-cart bg-color-first" type="submit" name="add_item" value="<?php get_setting('shopping_cart','add_cart'); ?>" title="<?php get_setting('shopping_cart','add_cart'); ?>"><i class="<?php get_setting('shopping_cart','font_class'); ?>"></i><span> <?php get_setting('shopping_cart','add_cart'); ?></span></button>
<?php if (return_setting('shopping_cart','use_cart_number')=='0') { ?>
<a class="btn btn-cart bg-color-first ml-5" href="<?php get_special_field('link','',false); ?>" title="<?php get_setting('shopping_cart','link_cart'); ?>"><i class="<?php get_setting('shopping_cart','link_class'); ?>"></i></a>
<?php } ?>
<a class="btn btn-cart bg-color-first ml-5" href="<?php get_site_url(); ?>basket/?cart=Y" title="<?php get_setting('shopping_cart','money_cart'); ?>"><i class="<?php get_setting('shopping_cart','money_class'); ?>"></i></a>
                                </form>
                            <?php } ?>
                            
                        </div>
                    </div>
                    
                <?php } else { ?>
                
                    <div class="excerpt<?php if (returnPageField(return_page_slug(),'full')=='on') { ?> col-xs-6 col-sm-4 col-md-3<?php } else { ?> col-xs-6 col-sm-6 col-md-4<?php } ?>">
                        <div class="thumbnail-cart-item thumbnail text-center">
               <?php if (return_special_field('hit')=='on') { ?>
                 <img class="hit" src="<?php get_theme_url(); ?>/images/hit-<?php get_setting('site_settings','select_color'); ?>.png" alt="Хит продаж" />
               <?php } ?>                            
                            <figure class="view view-tenth" itemscope itemtype="http://schema.org/ImageObject">
                                    <?php get_special_field_image('image','' . return_special_field('title') . '', '480', '' . return_setting('shopping_cart','cart_height') . ''); ?>
                                <figcaption class="mask bg-color-second" itemprop="caption">
                                    <a class="litebox info" data-litebox-group="group-your-gallery" data-litebox-text="<?php get_special_field('title','',false); ?>" href="<?php get_special_field('image','',false); ?>" itemprop="contentUrl"><i class="<?php get_setting('shopping_cart','search_class'); ?>"></i></a>
                                </figcaption>
                            </figure>
                            
                            <h3 class="<?php if (return_setting('shopping_cart','cart_height_h3')) { ?>cart-title-height-2 <?php } ?>cart-title font-size-<?php get_setting('shopping_cart','cart_fontsizer'); ?>" itemprop="name"><a href="<?php get_special_field('link','',false); ?>"><?php get_special_field('shorter','',true); ?></a></h3>
                            <?php if (return_special_field('text')) { ?>
                                <p itemprop="cart-description"><?php get_special_field('text','',false); ?></p>
                            <?php } ?>
                            
                            <?php if (return_special_field('discount')) { ?>
                                <p class="cart-price"><span class="title-price"><?php get_setting('shopping_cart','name_price'); ?></span><br><span class="strikeout"> <?php echo number_format(return_special_field('price','',false),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span><br><span class="price"> <?php echo number_format((return_special_field('price','',false) - return_special_field('discount','',false)),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>                
                                <p class="cart-discount"><?php get_setting('shopping_cart','name_discount'); ?><span><?php echo number_format(return_special_field('discount','',false),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>
                            <?php } else { ?>
                                <p class="cart-price"><span class="title-price"><?php get_setting('shopping_cart','name_price'); ?></span><span class="price"> <?php echo number_format(return_special_field('price','',false),0,'',' '); ?> <?php get_setting('shopping_cart','currency'); ?></span></p>
                            <?php } ?>
                            
                            <?php if (return_setting('shopping_cart','use_cart_setting')) { ?>
                                <form action="<?php echo $_SERVER['REQUEST_URI']?>" method="POST" class="form-inline add-form">
                                    <input type="hidden" name="id" value="<?php get_special_field('id','',false); ?>" />
                                    <input type="hidden" name="link" value="<?php get_special_field('link','',false); ?>" />
                                    <input type="hidden" name="name" value="<?php get_special_field('title','',false); ?>" />
                                <?php if (return_special_field('discount')){ ?>
                                    <input type="hidden" name="price" value="<?php echo return_special_field('price','',false) - return_special_field('discount','',false)?>" />
                                <?php } else { ?>
                                    <input type="hidden" name="price" value="<?php get_special_field('price','',false); ?>" />
                                <?php } ?>
                                <?php if (return_special_field('image')) { ?>
                                    <input type="hidden" name="image" value="<?php get_special_field('image','',false); ?>" />
                               <?php } ?>

                              <?php if (return_setting('shopping_cart','use_cart_number')) { ?>
                                    <div class="form-group">
                                        <input class="form-control cart-number" type="number" min="1" max="50" name="quantity" value="1" />
                                    </div>
                              <?php }  else { ?>
                                  <input type="hidden" name="quantity" value="1" />
                              <?php } ?>
                   <button class="btn btn-cart bg-color-first" type="submit" name="add_item" value="<?php get_setting('shopping_cart','add_cart'); ?>" title="<?php get_setting('shopping_cart','add_cart'); ?>"><i class="<?php get_setting('shopping_cart','font_class'); ?>"></i><span> <?php get_setting('shopping_cart','add_cart'); ?></span></button>
<?php if (return_setting('shopping_cart','use_cart_number')=='0') { ?>
<a class="btn btn-cart bg-color-first ml-5" href="<?php get_special_field('link','',false); ?>" title="<?php get_setting('shopping_cart','link_cart'); ?>"><i class="<?php get_setting('shopping_cart','link_class'); ?>"></i></a>
<?php } ?>
<a class="btn btn-cart bg-color-first ml-5" href="<?php get_site_url(); ?>basket/?cart=Y" title="<?php get_setting('shopping_cart','money_cart'); ?>"><i class="<?php get_setting('shopping_cart','money_class'); ?>"></i></a>
                                </form>
                            <?php } ?>
                            
                        </div>
                    </div>
                <?php } ?>
Reply
Hi
I was trying to create a CATALOG with the special pages. Following the steps of the tutorial from the official page but I'm not quite sure about some steps. For example, the extra field searchtags is a text, long text???.
I would like to know if there is another tutorial, a more detailed one to achieve the catalog
Reply
Windows 10 issue with file browser when using Special Pages


Hi Martin,


Having an issue with the site when using a Win10 machine. My client is unable to use the file browser to add a photo to a field in a Special Page. This may not be a Special Pages issue, but I thought I would start here. The client is still able to upload images and perform all other website update tasks.


I am able to update the site with no problem on a Win7 machine. I have screen captures to show the issue. The client tested IE, Chrome and Firefox (latest) and they all had the same problem as you will see in the sceen grab. The file browser is blank. 


Thank you for any help or suggestions for a work around you can provide.



.pdf   SS blank screen.pdf (Size: 18.32 KB / Downloads: 13)
Reply
(2016-08-13, 07:34:53)sarnaiz Wrote: Windows 10 issue with file browser when using Special Pages


Hi Martin,


Having an issue with the site when using a Win10 machine. My client is unable to use the file browser to add a photo to a field in a Special Page. This may not be a Special Pages issue, but I thought I would start here. The client is still able to upload images and perform all other website update tasks.


I am able to update the site with no problem on a Win7 machine. I have screen captures to show the issue. The client tested IE, Chrome and Firefox (latest) and they all had the same problem as you will see in the sceen grab. The file browser is blank. 


Thank you for any help or suggestions for a work around you can provide.

I updated the plug ins and that made no difference for the client being able to browse to a file. It did however cause another issue. Only one of each special page type would appear in the pages menu. It was very odd since all of them did appear on the live site, just not in the pages menu enabling the client to edit. So I have gone back to my back up. I wondered if it might have been a caching issue and tried flushing the cache but still the special pages did not appear in the pages tree menu.
Reply
At the cost of enormous efforts we managed to get sample code to crop images in the components Smile
Code:
<img src="<?php get_site_url(); ?>plugins/i18n_specialpages/browser/pic.php?w=360&h=360&amp;c=1&p=<?php $slugimage = explode('/uploads/', returnPageField($item->slug, 'YOUR_FIELD')); echo array_pop($slugimage); ?>" alt="<?php echo $item->title; ?>" />
Reply
(2016-10-23, 21:03:43)Oleg06 Wrote: At the cost of enormous efforts we managed to get sample code to crop images in the components Smile
Code:
<img src="<?php get_site_url(); ?>plugins/i18n_specialpages/browser/pic.php?w=360&h=360&amp;c=1&p=<?php $slugimage = explode('/uploads/', returnPageField($item->slug, 'YOUR_FIELD')); echo array_pop($slugimage); ?>" alt="<?php echo $item->title; ?>" />

Good evening,

I created a field of field selection.

How do I appear on the front end?

I need to create a selection field with all the items registered in the plugin configuration.

Greetings, BRAZIL <3
Reply
Good evening,

I created a field of field selection.

How do I appear on the front end?

I need to create a selection field with all the items registered in the plugin configuration.

Greetings, BRAZIL <3
Reply
(2016-10-23, 21:03:43)Oleg06 Wrote: At the cost of enormous efforts we managed to get sample code to crop images in the components Smile
Code:
<img src="<?php get_site_url(); ?>plugins/i18n_specialpages/browser/pic.php?w=360&h=360&amp;c=1&p=<?php $slugimage = explode('/uploads/', returnPageField($item->slug, 'YOUR_FIELD')); echo array_pop($slugimage); ?>" alt="<?php echo $item->title; ?>" />

Nice work! THANK YOU for your efforts! Big Grin
Reply
(2016-08-13, 07:34:53)sarnaiz Wrote: Windows 10 issue with file browser when using Special Pages


Hi Martin,


Having an issue with the site when using a Win10 machine. My client is unable to use the file browser to add a photo to a field in a Special Page. This may not be a Special Pages issue, but I thought I would start here. The client is still able to upload images and perform all other website update tasks.


I am able to update the site with no problem on a Win7 machine. I have screen captures to show the issue. The client tested IE, Chrome and Firefox (latest) and they all had the same problem as you will see in the sceen grab. The file browser is blank. 


Thank you for any help or suggestions for a work around you can provide.



I have the same problem over here, the file and image browsers aren't working on Chrome and FireFox on Win10 .
The only browser where it does work is Edge.
Reply
Well, I have to take my previous post back. In Edge I can open the file browser but not select an image. In Internet Explorer however I can both open the filebrowser and select an image. So that resolved my issue. Although it would be nice to be able to do this in Chrome and/or Firefox.
Reply
(2017-01-31, 05:50:02)fterschuur Wrote: Well, I have to take my previous post back. In Edge I can open the file browser but not select an image. In Internet Explorer however I can both open the filebrowser and select an image. So that resolved my issue. Although it would be nice to be able to do this in Chrome and/or Firefox.

Are you signed up with www or without www?
I have solved a similar problem with a 301 redirect in .htaccess

Code:
RewriteCond% {} ^ HTTP_HOST mysite.com $ [NC]
RewriteRule ^ (. *) $ Http://www.mysite.com/$1 [R = 301, L]
Reply
Well, apparently I was signed in whithout www. Logining in with www solved it.
Many thanks!
Reply
Hello! I found bug with plugins i18n and special pages. When I use get_i18n_content(), on special page "HTML/PHP code for the display of a page" doesn't work.
Reply
(2017-01-31, 05:50:02)fterschuur Wrote: Well, I have to take my previous post back. In Edge I can open the file browser but not select an image. In Internet Explorer however I can both open the filebrowser and select an image. So that resolved my issue. Although it would be nice to be able to do this in Chrome and/or Firefox.

Hello,

i'm having the same issues on a linux machine with chrome and firefox.
After searching for different solutions and none has been working (Chrome resulted in Error 500), i noticed that the custom_fields plugin also got a file browser.
However, they seem to be different. If you copy & paste the filebrowser.php of custom_fields plugin into the browser folder of the special_pages plugin, the filebrowser works again Smile.

Hope that helps to fix the issues.
Cheers.
Shasaar
Reply
Hello,

now i've got the problem that i can't figure out how to call the content of a special page.

I created a special page, added my fields and put the html code in the "view" tab (HTML/PHP code for the display of a page).
The page has been created, filled with content and when i click the "#" of that page in the overview, it all looks the way it should be.

Now if i call the page via <?php getPageContent('sidebar-startseite');?>, all i get is the content of the getsimple editor, but not the content defined in the special pages area. How do i call the display of the special page, the part that i defined in the view tab?

What am i doing wrong? I've been searching for an hour now but still missing the solution.

Thanks in advance.
Shasaar
Reply
Hm, does anybody have a solution for me please, or isn't there any?

I'd like to use the whole content of the special page as defined under the "View" tab (html / php code) defined under plugins/special page.
Any chance to get that code in my template without copy&pasting the whole in my template?
getPageContent and getSpecialPageContent doesn't work.

Thanks.
Shasaar
Reply
(2017-04-30, 17:06:24)Shasaar Wrote: getPageContent and getSpecialPageContent doesn't work.

That should be get_page_content() for the main content text and get_special_field($name) for the contents of a special field. See: http://mvlcek.bplaced.net/get-simple/i18nspecialpages for the other options.

If the Special Page 'View' field is empty and you have selected, for example, the default template, there will be no difference between the display of a special page and a normal page. The main content text will be displayed; the special fields will not be displayed.

If there is something in the 'View' field, that code will be used in place of the get_page_content() in the template.

I have never used the View feature of Special Pages in a production site, so there is almost certainly more to it than this. I just tried it out on a test site and this was the result of my observations.
--
Nick.
Reply
Hello Nick,

thank you for your message.
I tried your code, but it's not working, cause i want to add the SpecialPage content within the content of another page.
In general, i make a special page called "sidebar" and now i want to add the sidebars, to my template.
I can call the get_special_field within the "view" tab and set my html.

Now, a usual page can be called via getPageContent('sidebar'); but if i do so, all it shows is the content from the GS wysiwyg, but not the content which i defined for that special page.
That's kinda my problem Wink.

If i open the sole page "sidebar" with it's URL, it looks the way as it should, showing the special page defined content but not if i call it via getPageContent('xyz').

Any ideas?
Thanks in advance.
Shasaar
Reply
@Shasaar: I'll have to think about it. I understand what you are trying to do.

For my sidebar, I have a component 'sidebar', which contains:
Code:
<?php
// Echoes specific sidebar text for page, if it exists,
// otherwise echoes the default sidebar 'sb-full'.
get_i18n_content('sb-'.return_page_slug()) || get_i18n_content('sb-full');
?>

For each page with a custom sidebar, I have another (normal) page with the slug 'sb-<pageslug>'. The standard sidebar is a normal page with the slug 'sb-full'. The sb- pages are set private.

The template calls the sidebar content with <?php get_component('sidebar'); ?>.
--
Nick.
Reply
Hello Nick,

thank you again for your message.
I was trying the "get_i18n_content('xyz')" but even that one doesn't show the special pages content, only the content in the pages wysiwyg. If your sidebars would be special pages, it wouldn't work anymore i guess?

My main purpose for using special pages is the easy way for the customer to manage his side. It's easier for him to just input the image and let everything else the way it is. I use it to create content input for the customer as a form. So he can just add a special page of a product, add images, write title and description and thus has always the same fields to fill out without messing with the code, fonts, sizes, whatever. With the view tab, i can specifiy the design and once the customer has filled the form, each product page looks the same. That's just awsome, cause i can fix the look and feel, while the customer can concentrate on content.

I "misuse" the search-view tab already Tongue. Cause i use it to show a list of products in a small preview with the desired fields.
That works only with the search, but is a great solution if you're not a php-programmer.
I use the search as a "loop" to add the same html-code content over and over again, for as long as the desired tags comes with the products page.

Cheers.
Shasaar
Reply
@Shasaar: I have the Special Pages fields working as expected, but there are some things I still don't understand.

I have modified an existing site template to accept either normal pages or special pages, so there is some extra code that is not essential. There is no code in the 'View' tab for the Special Page. The Special Page has only one extra field ('sidebar'), set as WYSIWYG. This is the main body of the template:
PHP Code:
<div id="page">
    <h1><?php get_page_title(); ?></h1>
    <?php
    
// Echoes main content field for special pages or main page content
    get_special_field('content') || get_page_content();
 
   ?>
</div>
<div id="sidebar">
    <?php
    
// Echoes sidebar text for special pages, if it exists,
    // otherwise echoes the default sidebar 'sb-default' (normal page).
    get_special_field('sidebar') || get_i18n_content('sb-default');
    ?>
</div> 

While I was testing, I had a lot of frustration from changes that did not make any difference. It is essential to clear the browser cache and GS cache (admin->settings->'Flush all caches') frequently, even if you think it should not be necessary.

Even with frequent cache flushing, sometimes changes to the template file are not reflected in the output to the page. To force template changes, I found it necessary to change the page template setting for the Special Page (Edit Special Page type->Page Template), save the setting and then change the template back again. This may be because of the caching in the plugin: I was making changes to the template without changing the pages. If you make a new page, this may not be a problem.
--
Nick.
Reply
Dear Nick,

thank you very much for your reply.
Now, i got it! I was totally thinking wrong about how the special pages work in detail.

Alright ... instead of trying to link in a template and fetch the data out of a special page, i use the special page itself to be the template (defined in view tab) and can style it there instead of the template file itself.

Great, everything makes sense now Big Grin, thank you very much!
Must've really had some sort of a blockade.

Cheers.
Shasaar
Reply
Is it possible to change url-creating process in Special Pages? I need to create and change page url (using strftime pattern: parentslug-%d-%m-%y) with public/editing date, not with automatic create date?
Please, help.
Reply




Users browsing this thread: 5 Guest(s)