QUESTION open page in new window - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: QUESTION open page in new window (/showthread.php?tid=10622) |
open page in new window - df8oe - 2018-11-04 Is it possible to open specific paged in "new window" - via standard settings or via plugin? Greetings df8oe RE: open page in new window - Carlos - 2018-11-04 If you mean a link inserted in the page editor (ckeditor), you can edit the link properties and select as Target: New Window (_blank) RE: open page in new window - df8oe - 2018-11-04 Thanks - but I am meaning pages which are accessed via getsimple menu. RE: open page in new window - Alexander_ - 2018-11-06 (2018-11-04, 19:59:11)df8oe Wrote: Is it possible to open specific paged in "new window" - via standard settings or via plugin? No problem with i18n navigation. Frist create a component called "mynavigation". In this component you can check whether this site has to open in a new window or not. In this example, all menuitems which link to a pdf file are opened in target=_blank: PHP Code: <li class="<?php echo $item->classes; ?>"> Call your navigation in the template with PHP Code: <?php get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_NORMAL,'mynavigation'); ?> That's all. Alex RE: open page in new window - df8oe - 2018-11-07 Hi Alex, nice work and method. It works 100% but you have to add the menu entries manually to the template and if you change template you have to redo the changings. I am looking for something like that: (1) If you create a new page you get an option under "show this page in menu" where you can select the target (e.g. after "placement of menu entry"). Normally it is predefined as "same window" - but you can selevt other targets, too (2) If you put a complete URL to "slug" the created menu entry will be an external link - can be to a page or to a file. All text you put to the page is without any influence. But the position of the link in menu and the target are working in this "mode", too. It would be very easy implementation to getsimple base files. Both would need only a few lines to be added. I wonder if this feature is interesting for the project. It is overshooting to create a plugin for this. Additionally I haven't read the API documentation if this can ve done via plugin. If it is interesting for the project I would fork GitHub, do the additions and make a pull request. But I want to be future-proof so I do not want to make it only for my use. Every update would trash the additions. df8oe RE: open page in new window - vanfruniken - 2018-11-16 Hi df8oe, As to your point (1) The call PHP Code: <?php get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_NORMAL,'mynavigation'); ?> This component remains accessible from all templates within the same theme. The shared component 'mynavigation' takes care of the logic. If you need a menu, you would have to include the same call to get_i18n_navigation, so I don't understand your objection, unless you want to manually construct your very own <ul><li>... list. As far as the filtering goes (for the sake of example, Alex's code filters for .pdf filenames), but you could use different selection criteria to recognize the pages for which you wish to add ' "target=_blank" ' to the menu link. E.g., you could also use a tag (keyword), e.g., 'blank'. (Don't use '_blank', as some of mvlcek's i18n code gives special treatment to tags starting with '_' (using it as a prefix for a subcommand), and sometimes ignores such tags if you want to put them to use for your own purposes). Code: if (pageHasMetaTag('blank')) { echo ' target="_blank"'; } Code: function pageHasMetaTag($keyword) { |