• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: section title & MLE
PostPosted: Fri Sep 19, 2008 8:41 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 10, 2005 6:00 am
Posts: 109
Location: Sofia, Bulgaria
Hi,

I'm using the the {sectiontitle} plugin, but it seem that it only gets the default language's title of a section.
Can you help fix this? I got a website in ENG & BG.

Here is the plugin:

Code:
function smarty_cms_function_sectiontitle($params, &$smarty)
{
    global $gCms;
    $levels = isset($params["levels"]) ? $params["levels"] : 1 ;

        // which page are we viewing?
        $curPageID = $gCms->variables['content_id'];
        $curPage = ContentManager::LoadContentFromId($curPageID);

        // figure out the details of the current page and where it fits in
        // the content hierarchy
        $curHierarchy = $curPage->Hierarchy().'.';
        $theLevels = explode (".",$curHierarchy);
        $imSpec = $sectiontitle;
        $depth = substr_count($curHierarchy,'.');
        if ($levels < $depth)
            {
            $depth = $levels;
            }

            $hierCode = "";
            for ($j=0;$j<$depth;$j++)
                {
                $hierCode .= substr("00000",0,5-strlen($theLevels[$j])) . $theLevels[$j] . ".";
                }
            $hierCode = rtrim($hierCode,".");
            $db = $gCms->db;
            $query = "select content_alias, content_name from " . cms_db_prefix().
                "content where hierarchy=?";
            $dbresult = $db->Execute($query, array($hierCode));
            if ($dbresult && $dbresult->RecordCount() > 0)
                  {
                  $row = $dbresult->FetchRow();
                      $imSpec = strtolower($row["content_alias"]). "";
                  $imText = $row["content_name"];
                  }
    echo "${imSpec}";
}


Top
 Profile  
 
 Post subject: Re: section title & MLE
PostPosted: Fri Sep 19, 2008 3:39 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4820
Location: Ferrara, Italy
jd wrote:
I'm using the the {sectiontitle} plugin, but it seem that it only gets the default language's title of a section.


I see that display content_alias only and this param is same for each languages ....

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: section title & MLE
PostPosted: Thu Sep 25, 2008 1:43 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Thu Mar 10, 2005 6:00 am
Posts: 109
Location: Sofia, Bulgaria
Nope - it display's the title of the section. For instance it is in cyrilic. The aliases can't be in Cyrilic so it's not the alias.


Top
 Profile  
 
 Post subject: Re: section title & MLE
PostPosted: Thu Sep 25, 2008 2:03 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4820
Location: Ferrara, Italy
jd wrote:
Nope - it display's the title of the section. For instance it is in cyrilic. The aliases can't be in Cyrilic so it's not the alias.


If you have modify this tag with echo "${imText}" ok but if you have echo "${imSpec}" for me is alias name ( $imSpec = strtolower($row["content_alias"]). ""; )
however strange tag ....

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: section title & MLE
PostPosted: Thu Sep 25, 2008 2:31 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4820
Location: Ferrara, Italy
THIS IS UNTESTED!

Quote:
.................
global $mleblock;
            $query = "select content_alias{$mleblock} as content_alias, content_name{$mleblock} as content_name from " . cms_db_prefix().
                "content where hierarchy=?";
            $dbresult = $db->Execute($query, array($hierCode));
            if ($dbresult && $dbresult->RecordCount() > 0)
                  {
                  $row = $dbresult->FetchRow();
                      $imSpec = strtolower($row["content_alias"]). "";
                  $imText = $row["content_name"];
                  }
    echo "${imSpec}";
    echo ((isset($params["display"]) && $params["display"] == 'title') ? $imText : $imSpec);
.................


{sectiontitle display='title'}

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner