Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QUESTION open page in new window
#6
Hi df8oe,

As to your point (1)
The call
PHP Code:
<?php get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_NORMAL,'mynavigation'); ?>
does use the normal menu system (but with the _i18n_ variant). An unnumbered <ul><li>... list is generated, of which you are able to implement the rendering of the <li> entries yourself in the component 'mynavigation', which Alex adapted for your needs from mvlcek's i18n web page.
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"'; }
where 
Code:
function pageHasMetaTag($keyword) {
  $metaKeywordArr = array_map(trim,explode(',',get_page_meta_keywords(false)));
  return in_array($keyword,$metaKeywordArr);
}
I have this function tucked somewhere in a component and it already has served me well.
Reply


Messages In This Thread
open page in new window - by df8oe - 2018-11-04, 19:59:11
RE: open page in new window - by Carlos - 2018-11-04, 22:01:14
RE: open page in new window - by df8oe - 2018-11-04, 23:35:29
RE: open page in new window - by Alexander_ - 2018-11-06, 22:55:40
RE: open page in new window - by df8oe - 2018-11-07, 02:51:47
RE: open page in new window - by vanfruniken - 2018-11-16, 22:03:40



Users browsing this thread: 1 Guest(s)