Is possible to get the part of article before the cut in Joomla?

﹥>﹥吖頭↗ 提交于 2019-12-11 18:00:02

问题


I have the Joomla-site and I need to change the position of the part of text, which is intriductory text (before cut). "Change position" means set it at the top of article and the rest of text should be stay where it's now. So, becouse of the text of article is something constant thing I can't divide it in the parts by the usual tools of Joomla. May be is possible the get intro text in some php-variable and set it to the module, which I can insert where I need?

Thanks.


回答1:


To cut an "article" in half and split those to different dirrectly isn't possible. However there are workarounds:

1) If it isn't a big deal, i mean if just by adding some css/html code would do the job, like you need a seperator or something then you should install JCE Editor

2) If you want to show some message to a specific page in a whole different position module then you should change a little bit the template your using by adding some PHP code. Let's say you have a contact page where you want a link to your fb or something like that... Open your template index.php, go to the place where you want to add it and add those lines of code ....

<?php 
    $currentpage = JSite::getMenu()->getActive()->name ;   
     $currentpage = JSite::getMenu()->getActive()->title;  // for joomla 2.5 remove this if your using another version
    if($currentpage == "Contact"){
        echo '<p>Go visit <a href="http://facebook.com/xyz">my page</a> !</p>';
        echo '<jdoc:include type="modules" name="Contact_message" />'; // if you want to add a position for your contact page and so you can add some custom modules to add some text or whatever you want ...
    }
?>

You may change/add code depanding on your needs ... Hope this was helpful !



来源:https://stackoverflow.com/questions/10774619/is-possible-to-get-the-part-of-article-before-the-cut-in-joomla

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!