Jump to content

IP page Building menu link and pulling data


Eudemon

Recommended Posts

Posted

in page building, without using IPB template

would like to know how to pull menu item from the system

maybe something like this

{foreach menu}

{button}

{end}

also want to know how to pull activity data as well as applying some filter, and pulling the language button

trying looking into documentation and digging in theme, couldn't find it

I know there is an output object, but how do I find the calls that I can use?

Posted
5 hours ago, Eudemon said:

in page building, without using IPB template

would like to know how to pull menu item from the system

maybe something like this

{foreach menu}

{button}

{end}

also want to know how to pull activity data as well as applying some filter, and pulling the language button

trying looking into documentation and digging in theme, couldn't find it

I know there is an output object, but how do I find the calls that I can use?

Not sure if helps but what I done was copied the whole globalTemplate into a new Pages template and removed the bits I do not need

Remember to make sure all your pages are set to use your new template

Posted

I am just building one single page, so not using any template

just tested with globalTemplate, the code that pulls menu items is

{template="navBar" app="core" group="global" params=""}

however, it will just pull all the links including some links i don't want and i can't style each one individually

I know I can just build one menu myself but i want to preserve the language setting

maybe I need to look at what this part stores and build two menu based on the value, any idea?

lang="{expression="\IPS\Member::loggedIn()->language()->bcp47()"}"

 

Posted
16 hours ago, Eudemon said:

maybe I need to look at what this part stores and build two menu based on the value, any idea?


lang="{expression="\IPS\Member::loggedIn()->language()->bcp47()"}"

 

That's the bit that states "lang="eo-US", lang="eo-GB" etc.

If you wanted to create specific content per language then you could use a structure along the lines of

{{if \IPS\Member::loggedIn()->language()->short === 'eo_XX.UTF-8' }}
<p><em>HTML to display for Esperanto</em></p>
{{else}}
<p><em>HTML to display for another language, including English</em></p>
{{endif}}

but probably even better is to create language strings which feature the HTML and then call them in the template.

Posted

thanks for the reply, one concern is i don't know whether this code will reflect on non-logged in guests

\IPS\Member::loggedIn()->language()->short === 'eo_XX.UTF-8'
Posted
10 hours ago, Eudemon said:

thanks for the reply, one concern is i don't know whether this code will reflect on non-logged in guests

I had the same fear myself because it looks as though it shouldn't. So I've just logged out and confirmed on a test page on my own site and it's working:

en.thumb.jpg.3fa9126b07e3985bb5273a3e07f

eo.thumb.jpg.1b1b7e4c3a7876f2c2d67bd8363

Posted

this problem might seem noob but

how do I find out what this part returns

\IPS\Member::loggedIn()->language()->short

and how do I call a language string let's say the word "blog" that has key "__api_blog_blogs"

 

Is there any guide for finding out these kind of parameters? I tried digging the forum and documentation but no luck

thanks

Posted
5 hours ago, Eudemon said:

how do I find out what this part returns


\IPS\Member::loggedIn()->language()->short

{expression="\IPS\Member::loggedIn()->language()->short"}

5 hours ago, Eudemon said:

and how do I call a language string let's say the word "blog" that has key "__api_blog_blogs"

{lang="__api_blog_blogs"}

5 hours ago, Eudemon said:

Is there any guide for finding out these kind of parameters? I tried digging the forum and documentation but no luck


Not that I know of. And I've tried looking a lot because I'm totally new to this sort of thing!

Posted

thanks a lot

9 hours ago, Meddysong said:

And I've tried looking a lot because I'm totally new to this sort of thing!

it seems like they really need to improve their documentation

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...