Results 1 to 2 of 2

Thread: Catalog Reference - How to make it invisible (now shows ID)

  1. #1
    User
    Join Date
    07-13-09.
    Posts
    83

    Default Catalog Reference - How to make it invisible (now shows ID)

    Okay, maybe helpful for some. But unfortunately just half-way through.
    I build a catalog with projects (for a structural designer).
    The client wants to show all the works he has been involved in. Some works were planned by architects, some by artists.
    Now he has two more catalogs in which he enters either architects or artists.
    In his main catalog he chooses from either one or the other catalog.

    That´s how it looks in the backend:


    In this case it is a project by an Artist "Erwin W". But, if the user EVER clicks the "Architekt" Checkbox and an Architekt from the list that pops up, this architect will always be displayed in the frontend, even if the checkbox "Architekt" is unchecked.
    Now, made I´ve done is to create 2 reference modules. One for architects and on for artists.
    I´ve made the following templates:

    Module Catalog Reference Architects:
    Code:
    <?php if (count($this->entries)): ?>
    
    <div class="layout_full">
    
    <?php foreach ($this->entries as $entry): ?>
    
    <div class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
    
    
    
    
    <div id="archart">
    
    <h2>Architekt</h2>
    <?php if ($entry['data']['architect_check']['raw']):?>
    <?php echo $entry['data']['title']['value']; ?>
    <?php endif; ?>
    
    
    
    
    <?php foreach ($entry['data'] as $field=>$data): ?>
    <?php if (strlen($data['raw']) && !in_array($field, array('catalog_name','parentJumpTo'))): ?>
    
    
    <div class="field <?php echo $field; ?>">
    	<div class="label"><?php echo $data['label']; ?></div>
    	<div class="value"><?php echo $data['value']; ?></div>
    </div>
    
    </div>
    
    
    <?php endif; ?>
    <?php endforeach; ?>
    </div>
    <?php endforeach; ?>
    </div>
    
    <?php else: ?>
    <?php endif; ?>
    Module Catalog Reference Artists:
    Code:
    <?php if (count($this->entries)): ?>
    
    <div class="layout_full">
    
    <?php foreach ($this->entries as $entry): ?>
    
    <div class="item<?php echo $entry['class'] ? ' '.$entry['class'] : ''; ?>">
    
    
    
    
    <div id="archart">
    
    <h2>Künstler</h2>
    <?php if ($entry['data']['artist_check']['raw']):?>
    <?php echo $entry['data']['title']['value']; ?>
    <?php endif; ?>
    
    
    
    
    <?php foreach ($entry['data'] as $field=>$data): ?>
    <?php if (strlen($data['raw']) && !in_array($field, array('catalog_name','parentJumpTo'))): ?>
    
    
    <div class="field <?php echo $field; ?>">
    	<div class="label"><?php echo $data['label']; ?></div>
    	<div class="value"><?php echo $data['value']; ?></div>
    </div>
    
    </div>
    
    
    <?php endif; ?>
    <?php endforeach; ?>
    </div>
    <?php endforeach; ?>
    </div>
    
    <?php else: ?>
    <?php endif; ?>
    This ALMOST works. The problem now:
    If the checkbox for Artists is unchecked the artist will not be display but the ID is always shown.
    I have no Idea how to get rid of that.


    If I uncheck the Architects and check the Artists, it´s just the other way around: the ID for the Architects shows up and the name of the artists in the second module...

    Here a link to the module: https://skitch.com/valentinruhry/rg5...source-cms-2.9

    Thanks for your help!
    Best,
    Valentin

  2. #2
    User
    Join Date
    07-13-09.
    Posts
    83

    Default Re: Catalog Reference - How to make it invisible (now shows

    Okay, after some days playing around I came to the following:
    The number that is displayed in the Frontend, when the Refernce Module doesn´t display Data is the ID of the Catalog that it is linked with.
    I had to change the mod_catalogrefernce.tpl from
    Code:
    <?php if (!$this->searchable): ?>
    
    <?php endif; ?>
    <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->catalog; ?>
    
    </div>
    <?php if (!$this->searchable): ?>
    
    <?php endif; ?>
    to
    Code:
    <?php if (!$this->searchable): ?>
    
    <?php endif; ?>
    <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; ?>
    <?
    if (!is_numeric($this->catalog))
    echo $this->catalog; 
    ?>
    
    
    </div>
    <?php if (!$this->searchable): ?>
    
    <?php endif; ?>
    Now, the numbers are not displayed anymore.
    Hope that this can be helpful for somebody.

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
  •