是否可以在Joomla剪切之前获得文章的一部分? [英] Is it possible to get the part of article before the cut in Joomla?

查看:63
本文介绍了是否可以在Joomla剪切之前获得文章的一部分?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Joomla网站,我需要更改文本部分的位置,即介绍性文本(剪切前). 更改位置"意味着将其设置在文章的顶部,其余文本应保留在当前位置.因此,由于文章的文本是固定不变的东西,因此我无法通过Joomla的常用工具将其分为几个部分.可以在一些PHP变量中获取介绍文本并将其设置为模块,我可以在需要的位置插入该模块?

I have a Joomla site and I need to change the position of the part of text, which is introductory 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, because 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?

推荐答案

将文章"切成两半,然后直接将其拆分成不同的内容是不可能的.但是,有一些解决方法:

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

1),如果没什么大不了的话,我的意思是如果仅通过添加一些CSS/HTML代码就可以完成这项工作,例如您需要一个分隔符之类的东西,那么您应该安装 JCE编辑器

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)如果要在完全不同的 position模块中向特定页面显示一些消息,则应通过添加一些模板来更改使用的模板PHP代码.假设您有一个联系页面,您想在该页面上链接到您的fb或类似的东西... 打开模板index.php,转到要添加模板的地方,然后添加这些代码行....

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 !

这篇关于是否可以在Joomla剪切之前获得文章的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆