Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
you need to count it manually as far as I know, here's my breadcrumbs.inc.php file from an older project, maybe it'll help (it was on a site with a blog, so there are rules for categories and tags)

PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); } ?>
<?php 
if(return_page_slug()!="index") {

$links return_i18n_breadcrumbs(return_page_slug());
$separator ' <i class="icon fa-angle-right"></i> ';
?>
<div id="breadcrumbs">
    <div class="container" itemscope itemtype="http://schema.org/BreadcrumbList">
        <span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
            <a href="<?php echo find_url('index',null); ?>" title="Domov" itemprop="item" class="domov">
                <i class="icon fa-home fa-lg"></i><span class="visuallyhidden" itemprop="name"><?php get_site_name(); ?></span>
            </a><?php echo $separator?>
            <meta itemprop="position" content="1"/>
        </span>
        <?php
        $n 
count($links);    $gparent "";
        for(
$i=0$i<$n$i++) {
            if(
$i==$n-1$separator "";
            if(
$links[$i]['menu']!=""$title $links[$i]['menu'];
            else 
$title $links[$i]['title'];
            
$gparent = (empty($gparent)) ? $links[$i]['parent'] : $gparent;
            if(
$gparent != $links[$i]['parent']) {
                
$links[$i]['parent'] = $gparent.'/'.$links[$i]['parent'];
            }
            if(
$links[$i]['parent']!=""$links[$i]['parent'] = "/".$links[$i]['parent'];
            
$finalurl rtrim($SITEURL,"/").$links[$i]['parent'].'/'.$links[$i]['url'];
            if(
$finalurl==$SITEURL.'index'$finalurl rtrim($SITEURL,"/");
            echo 
'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">',
                    
'<a href="'.$finalurl.'" itemprop="item" title="'.$links[$i]['title'].'">',
                        
'<span itemprop="name">'.$title.'</span>',
                    
'</a>'.$separator,
                    
'<meta itemprop="position" content="'.($i+2).'"/>',
                
'</span>',"\n";
        }
        if(
return_page_slug() == "blog") {
            
$separator ' <i class="icon fa-angle-right"></i> ';
            if(
nm_is_single()) {
                
$all nm_get_posts();
                foreach (
$all as $post) {
                    if(
$post->slug == nm_post_slug(false)) {
                        echo 
$separator;
                        echo 
'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">',
                            
'<a href="'.nm_post_url(false).'" itemprop="item" title="'.$post->title.'">',
                            
'<span itemprop="name">'.$post->title.'</span>',
                            
'</a>',
                            
'<meta itemprop="position" content="'.($i+2).'"/>',
                        
'</span>';
                    }
                }
            }
            elseif(
nm_is_tag()) {
                echo 
$separator;
                echo 
'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">Značka: ',
                            
'<a href="'.$SITEURL.'blog/tag/'.$_GET[NMPARAMTAG].'" itemprop="item" title="'.$_GET[NMPARAMTAG].'">',
                            
'<span itemprop="name">'.$_GET[NMPARAMTAG].'</span>',
                            
'</a>',
                            
'<meta itemprop="position" content="'.($i+2).'"/>',
                        
'</span>';
            }
            elseif(
nm_is_archive()) {
                echo 
$separator;
                
$newtime $_GET[NMPARAMARCHIVE];
                echo 
'<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">Archív: ',
                            
'<a href="'.$SITEURL.'blog/archive/'.$_GET[NMPARAMARCHIVE].'" itemprop="item" title="'.$newtime.'">',
                            
'<span itemprop="name">'.$newtime.'</span>',
                            
'</a>',
                            
'<meta itemprop="position" content="'.($i+2).'"/>',
                        
'</span>';
            }
        }
        
?>
    </div>
</div>
<?php 
Reply
Thanks, I'll try to understand.
Reply
try to include it as a file in template (that's how it's meant to work), it should work out of the box for whole site, if you have News Manager, it'll show the extended part..
Reply
We have installed this I18N Plugin and we are using this for Hierarchical Menus .

We are seeing the following Error Messages now and then in the
/home/xxxx/public_html/data/other/logs/errorlog.txt File:
Code:
PHP Fatal error:  I18nNavigationFrontend::outputMenu(): Cannot use output buffering in output buffering display handlers in [no active file] on line 0

Please guide us as to what to do in this regard.

Thanks,

Lakshmanan
Reply
Is it possible for the breadcrumbs to end in something other than the slug? I would like for that to just use the title of the page, if possible.

If anyone can suggest a modification to the component, I would be grateful. Thanks!
TOEFL Resources: My GetSimple based site!
Reply
(2019-02-26, 00:52:02)Carlos Wrote: Try changing i18n_navigation/frontend.class.php line 219
Code:
           'haschildren' => $showChildren ? count($children) > 0 : self::hasChildren($childurl, $show)

to this:
Code:
           'haschildren' => $showChildren ? $children && count($children) > 0 : self::hasChildren($childurl, $show)

(Not tested.)

Dear Carlos,

The problem-causing line is still in the actual version and I changed the line, now it is ok at my client's site
Will there be an update in future?

Thanks for all help,

Connie
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
No idea if mvlcek or anyone will ever update this plugin. But I suppose that if someone did, he/she would fix this issue.
Reply
Hi,

can someone explains why my "Sub Menu 1" doesn't appear under "Menu 2" ? although in page management, it's correct ...

[Image: sm1.jpg]

[Image: sm2.jpg]

thanks in advance,
Domi.
Reply
Try these themes.
http://get-simple.info/extend/theme/inno...-menu/961/
http://get-simple.info/extend/theme/new/963/
http://get-simple.info/extend/theme/uikit/1207/
Reply
(2020-07-09, 05:07:08)Oleg06 Wrote: Try these themes.
http://get-simple.info/extend/theme/inno...-menu/961/
http://get-simple.info/extend/theme/new/963/
http://get-simple.info/extend/theme/uikit/1207/

Thanks for this Oleg but I have already make my own theme, I just want to find a solution (simple if possible) for sub-menus.

Rgds,
Domi.
Reply
(2020-07-09, 07:14:22)Domi Wrote:
(2020-07-09, 05:07:08)Oleg06 Wrote: Try these themes.
http://get-simple.info/extend/theme/inno...-menu/961/
http://get-simple.info/extend/theme/new/963/
http://get-simple.info/extend/theme/uikit/1207/

Thanks for this Oleg but I have already make my own theme, I just want to find a solution (simple if possible) for sub-menus.

Rgds,
Domi.
I think it will not be difficult for you if you are familiar with CSS or JS
Reply
(2020-07-09, 08:59:41)Oleg06 Wrote:
(2020-07-09, 07:14:22)Domi Wrote:
(2020-07-09, 05:07:08)Oleg06 Wrote: Try these themes.
http://get-simple.info/extend/theme/inno...-menu/961/
http://get-simple.info/extend/theme/new/963/
http://get-simple.info/extend/theme/uikit/1207/

Thanks for this Oleg but I have already make my own theme, I just want to find a solution (simple if possible) for sub-menus.

Rgds,
Domi.
I think it will not be difficult for you if you are familiar with CSS or JS

Just tried them but as these themes used i18n, I get the same problem as shown in my previous post/pictures.
btw thx.
Domi.
Reply
Use breadcrumb area to show subpages not breadcrumbs if you use i18n menu
Reply
(2020-07-09, 20:01:26)Riianna Wrote: Use breadcrumb area to show subpages not breadcrumbs if you use i18n menu

Thanks for your reply but I don't understand what you mean ... can you be more explicit or a small example please.

Rgds,
Domi.
Reply
(2020-07-10, 17:59:48)Domi Wrote:
(2020-07-09, 20:01:26)Riianna Wrote: Use breadcrumb area to show subpages not breadcrumbs if you use i18n menu

Thanks for your reply but I don't understand what you mean ... can you be more explicit or a small example please.

Rgds,
Domi.

Like this example. i uset below code replacing breadcrumps in header.inc file between
<!-- breadcrumbs: only show when NOT on homepage --> and </header>
and a bit styling
.subpages li{display:inline;list-style-type:none;padding-right: 20px;text-decoration:none;
PHP Code:
<?php
  $bc 
return_i18n_breadcrumbs(return_page_slug());
 
 $slug $bc[0]['url'];
 
 $pages return_i18n_pages();
 
 if (@$pages[$slug]['children']) {
    echo 
'<div class="breadcrumbs"><span class="wrapper"><ul class="subpages">';
 
   get_i18n_navigation(return_page_slug(),1,99);
    echo 
'</ul></span></div>';
 
 }
?>
Reply
Do you need a drop down menu? Or is my Google stupid?
Or is my Google stupid?
https://getsimplethemes.ru/free-themes/uikit/uikit-1/
Reply
Who else agrees that uikit is bloatware ?
Reply
Please define bloatware?

At least not more bloatware than other CSS frameworks e.g. Bootstrap etc. Nevertheless, it can make work a lot easier and you save a lot of time - as with most CSS frameworks.
Reply
(2020-07-11, 02:18:28)Felix Wrote: Who else agrees that uikit is bloatware ?

I checked my site for viruses on three services. No viruses were detected.
Reply
Quote:please define bloatware

Yes let's define bloatware here.

uikit.min.js is around 130 kb
why would I load a 130 kb library and then only need 5% of it's classes for a website ?
Or lose time to find out how to recompile uikit for only the classes I would need ?

Lets code some uikit in a html layout:

class="uk-width-auto@m uk-nav uk-navbar-container uk-grid-small uk-height-medium uk-column-1-3 uk-width-1-2 . . . ."
really ??

not even talking about how much time it would need to learn all uikit's classes
uikit, bootstrap, etc, are only useful for coding conformity in a team of coders

one man shows and freelancers will certainly choose something bloat free, super flexible and fast
like: https://arnaudleray.github.io/pocketgrid/

But if you really want a kick-ass css framework that blows all the rest out of the water:
https://microcipcip.github.io/gridy/#!/

F.
Reply
(2020-07-11, 07:04:27)Felix Wrote:
Quote:please define bloatware

Yes let's define bloatware here.

uikit.min.js is around 130 kb
why would I load a 130 kb library and then only need 5% of it's classes for a website ?
Or lose time to find out how to recompile uikit for only the classes I would need ?

Lets code some uikit in a html layout:

class="uk-width-auto@m uk-nav uk-navbar-container uk-grid-small uk-height-medium uk-column-1-3 uk-width-1-2 . . . ."
really ??

not even talking about how much time it would need to learn all uikit's classes
uikit, bootstrap, etc, are only useful for coding conformity in a team of coders

one man shows and freelancers will certainly choose something bloat free, super flexible and fast
like: https://arnaudleray.github.io/pocketgrid/

But if you really want a kick-ass css framework that blows all the rest out of the water:
https://microcipcip.github.io/gridy/#!/

F.

You use the jQuery library, and it also weighs a lot, and you do not use all its features. If you use only CSS for your sites, won't your sites be boring and monotonous?
You can use much more UIkit functionality https://getsimplethemes.ru/vizit/barber/barber-en/

And UIkit is significantly better than Bootstrap. Smile
Reply
Well... I think that bloatware is a very relative term. One man's bloatware, another man's just the right level of abstraction or usability. I think that's a very limited view. There are a lot more factors than just the size of the library to consider, otherwise you risk getting tunnel vision.

Hmm, according to your statement, practically everything that has a certain degree of abstraction can be bloatware.
Let's take a closer look on it. In some of your earlier examples I have seen code like this:

PHP Code:
echo "<a href=" '"' ........ ">" "\n"

Your browser doesn't need an Escape Sequence ("\n"), and developer console doesn't need it either, it automatically adds a line break at the end to make your code look good. It does not have any significant functionality, right? So if you add a few of these "\n" to your script it will also become bloatware?

Let's see another example. The one developer writes his variable names like this:

PHP Code:
var arrivalDateTimeStamp = ... 

If you have 10000 lines of code and many large variables like this, does your script become bloatware?

There is a different way, another developer can do it as follows:

PHP Code:
var adts = ... 

Your code will be much smaller, but unfortunately also badly readable. So you get some space at the expense of usability (If I had the choice, I would definitely choose the first option).

There are countless examples that say that size is not everything.


Next, let's take a look at your arguments:

(2020-07-11, 07:04:27)Felix Wrote: `why would I load a 130 kb library and then only need 5% of it's classes for a website ?`

Okay, um... What if I use 50- or even 60% of its functions, can I use it then, won't it become bloatware? Or better said: At what percentage of the used functionality does a framework not become bloatware? From your point of view, practically every library/framework is bloatware, since you usually use only a part of its functions. Sometimes, even the complete programming language like PHP is bloatware. Example, if you want to call a website and only want to make a simple "if" and "else" queries, but the PHP interpreter on the server must start as a process. Notice anything?

(2020-07-11, 07:04:27)Felix Wrote: `uikit, bootstrap, etc, are only useful for coding conformity in a team of coders`

Not only, there are many application possibilities. Be it just the time where you can save by using frameworks. Even if you don't want to reinvent the wheel and use the already existing functions. Or simply because you are not really a great designer and just want to have a basic framework to adapt it to your personal style with minimal effort etc.

(2020-07-11, 07:04:27)Felix Wrote: `one man shows and freelancers will certainly choose something bloat free, super flexible and fast`

Fine, but UIkit, Bootstrap, etc is more than just a grid, it offers much more functionality and if you use it you can often avoid having to include jQuery or custom JS, which in turn compensates for the ridiculous few KB of size on the server.

As you can see, size is not everything, there are more important things to consider.

To me, a bloatware just means something that grows with time and loses its original aptitude, size or functionality.
Windows is a good example for that. I am not quite sure where we stand on that (not used Windows for a very-very long time) but, in the past, it was really bloatware for me: A few months after the installation, the system was still running "okay" (so no bloatware yet), after that the system became larger, messy and slow and almost didn't work anymore (now it has become f*g bloatware) ;-)
Reply
Great "article" Bigin Smile.
"You don't want to reinvent the wheel and use the already existing functions"
Absolutely, everything is allready done Smile.
Reply
@Bigin
Thanks for taking time writing your view about it. Having seen your work you are a more experienced coder
and we are fortunate to have you here. So clearly you can put it in a wider perspective.
I only narrow it down to practical matters.
For me UIkit tries to be an all in one components package. Instead of selecting components from a package,
I prefer third party libraries who are smaller and were specially made for the job.
But since UIkit is so popular, maybe I am overlooking something.
Reply
Quote:You don't want to reinvent the wheel - absolutely, everything is already done

@Riianna
You maybe surprised, but yes I fully agree with that. A good example source
where I search and find everything already done is here:
https://www.jqueryscript.net/  or here:  https://www.cssscript.com/
and of course at github.
Reply




Users browsing this thread: 7 Guest(s)