Is possible to get the part of article before the

2019-09-01 08: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 !