English 中文(简体)
how to hide joomla content from frontpage but not from inner pages
原标题:

i m using yootheme joomla template in joomla 1.5.x, my problem is that i want to

  • display modules (if enabled ) on front page, no joomla content ( i.e. localhost/project or localhost/project/index.php)

and

  • display contents & modules ( if enabled ) both on inner pages

my problem is that on front page (template/yoo_symphony/index.php) if i write

<jdoc:include type="component" />

then front page display only contents , no modules :(

and if i write as suggested on here and here

$pageview = JRequest::getVar( option ,  , GET );
if(!empty($pageview) ) : ?>
  <jdoc:include type="component" />
<?php endif; ?>  

then front page display all modules but inner pages not display any contents

i have read many articles regarding this, but no hope...:(

please provide me a perfect solution so that i can display modules on front page as well as content on inner pages


NOTE: if i write print_r($_GET) on http://localhost/project or http://localhost/project/index.php then it results

Array
(
    [option] => com_content
    [view] => article
    [id] => 44
    [Itemid] => 53
)

means there is url rewriting on front page, my main problem is that how to distiniguish front page from other pages??

ANSWER:

I got answer from my senior, Need to do below steps

1> go to joomla administrator side
2> then navigate to menu-->main menu [ Menu Item Manager :[mainmenu] ]
3> click to Home ( i.e. your default menu item )[ Menu Item: [ Edit ] ]
4> now click on change type [ Change Menu Item ]
5> select Internel link-->Articles -->Front Page -->Front Page Blog Layout
6> Apply & save
7> now go to index.php and replace <jdoc:include type="component" /> with

<?php  if($_GET[ view ] !==  frontpage  ) :?>
     <jdoc:include type="component" />
<?php endif;?>

NOTE : if i write print_r($_GET) on http://localhost/project or http://localhost/project/index.php then it returns

Array
(
    [option] => com_content
    [view] => frontpage  // see now 
    [id] => 44
    [Itemid] => 53
)
最佳回答

I do this on several sites when I really don t need anything but modules on the home page. This works perfectly everywhere I have ever used it. Just add this in your template.

<?php
$menu = &JSite::getMenu();
if ($menu->getActive() != $menu->getDefault()) {
?>
    <jdoc:include type="component" />
<?php } ?>

One more thing to mention, In this way you will not get the Search results, as they are displayed on default page. - If you create a search page menu item, which you should if you want to control the modules on that page, then this will not affect the search page at all.

问题回答

暂无回答




相关问题
Working with modules in IntelliJ IDEA

As I understand, using modules allows us to control some dependencies. I mean that we can allow one module to interact with another one but not vise versa. We also can make some reusable things and ...

Module import path

I m unable to test-run a cssparser that I d like to use. test.py: from css.parse import parse data = """ em { padding: 2px; margin: 1em; border-width: medium; border-style: ...

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk. The project does NOT use the mx framework. What i want to have is: A big MAIN project several small ...

Test modules with Test::Unit

I encountered a problem when trying to test a module with Test::Unit. What I used to do is this: my_module.rb: class MyModule def my_func 5 # return some value end end test_my_module.rb: ...

Drupal section accessible by role

I need to limit access of content on Drupal site based on the Drupal User s Role. http://site.com/managers/intro http://site.com/managers/reviews http://site.com/managers/up-for-raises The ...

How to find where a function was imported from in Python?

I have a Python module with a function in it: == bar.py == def foo(): pass == EOF == And then I import it into the global namespace like so: from bar import * So now the function foo is ...

How to wire two modules in Verilog?

I have written two modules DLatch and RSLatch and i want to write verilog code to join those two.

热门标签