Results 1 to 5 of 5

Thread: [solved] <?php if ($this->headline): ?> NOT SHOWING

  1. #1
    User
    Join Date
    08-04-09.
    Posts
    230

    Default [solved] <?php if ($this->headline): ?> NOT SHOWING

    I am trying to achieve this way of subnavigation as well.
    This seems like a very good solution.

    The only thing is, if I alter my mod_navigation.tpl according to the above it does not show up in my code.

    The headline is not showing up at all.

    Code:
    <div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
    
    <?php if ($this->headline): ?>
    
    <<?php echo $this->hl; ?>>
    <?php echo $this->headline; ?></<?php echo $this->hl; ?>>
    <?php endif; ?>
    
    <?php echo $this->skipNavigation; ?>
    <?php echo $this->items; ?> 
    <a name="<?php echo $this->skipId; ?>" id="<?php echo $this->skipId; ?>" class="invisible"> </a>
    
    </div>
    Is showing up in my source as:

    Code:
    <div class="mod_navigation subnav block">
    
    
    Navigatie overslaan
    
    <ul class="level_1">
    As you can see no h1 in between mod_navigation class and the invisible class.

    What am I leaving out? I just can't seem to solve it.

  2. #2
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: <?php if ($this->headline): ?> NOT SHOWING

    Perhaps a stupid question, but did you fill in a title with the module. And if you included the module anywhere else then in a page layout, then the headline might be overwritten so check that as well.

    Less stupid question: does the original template work if you change only that??

  3. #3
    User
    Join Date
    08-04-09.
    Posts
    230

    Default Re: <?php if ($this->headline): ?> NOT SHOWING

    Hey Vera,

    Stupid questions do not exist! Thanks for looking into my 'problem'

    I did add a headline in the module, then it indeed shows up.

    I think I might have misunderstood what they are trying to achieve in this topic

    I can indeed give the module a title and it will link to main_nav after altering the mod_navigation template as discussed in the topic mentioned above.
    But this way I will have to make a seperate module for each page that has a subnavigation.

    Not really a problem of course, but it would have been easier if the headline text is replaced by the page title.

  4. #4
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: <?php if ($this->headline): ?> NOT SHOWING

    Why don't you just remove the if statement and put the {{env::main_title}} in instead of this->headline.

    So you'd get something like
    Code:
    <h1>{{env::main_title}}</h1>
    instead of:
    Code:
    <?php if ($this->headline): ?>
    
    <<?php echo $this->hl; ?>>
    <?php echo $this->headline; ?></<?php echo $this->hl; ?>>
    <?php endif; ?>

  5. #5
    User
    Join Date
    08-04-09.
    Posts
    230

    Default [solved] Re: <?php if ($this->headline): ?> NOT SHOWING

    Hey Vera, thanks a lot!

    I already figured it out, came back to the forum to post my solution. (same as yours)

    Thanks heaps for your help!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •