REQ : Generate list from comma separated values in a same path.php global variable
Posted: 24 August 2006 07:34 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  301
Joined  06-28-2006

I would like to generate a list of available languages for a blog.

I’m building a multilingual template that several blogs could use.
Each blog could have a specific set of available languages.
As I don’t want the template to hold any blog specific information, the only place to set the list of available languages for a blog is in its path.php as a global variable.

"available_languages" => 'en, fr, es',

Clicking any language link from the list would switch the page’s language, for any template, this requires the URI of the new language page to be generated dynamically.

So it seems that the only way to have such list is to use a plugin similar to List Maker
But by list I mean that for each language something will be output, I don’t want the plugin to add more than what is wrapped in its tags.

The plugin would fetch the list from the specified variable in the specified file and for each language it would output the HTML wrapped inside its tags.
EE tags an other path.php global variable would also need to be wrapped in to generate the URI.
Or the plugin to be wrapped in EE tags, I don’t know.

Example :

{exp:global_variable_list_maker global_variable_file_path="/home/web/ee/path.php" global_variable="available_languages"}
<li>
{exp:weblog:entries weblog="{x_blog_short_name}" limit="1"}    
<a href="{title_permalink="post"}{global_variable}/" rel="alternate" hreflang="{global_variable}" title="<!-- language's full name -->">
<
img src="{x_ee_directory}images/languages/{global_variable}.gif" alt="{global_variable}" height="20" />
</
a>
{/exp:weblog:entries}
</li>
{/exp:global_variable_list_maker}

Ideally the language’s full name should also be displayed - I don’t know the best way to do this.

Anyone interested ?

 Signature 
Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120313 Total Logged-in Users: 75
Total Topics: 126431 Total Anonymous Users: 33
Total Replies: 664867 Total Guests: 375
Total Posts: 791298    
Members ( View Memberlist )