Checkbox Items Visibility in Frontend

Define multiple catalogs, each with their own custom field types

Moderators: thyon, xtra

Re: Checkbox Items Visibility in Frontend

Postby valentin » Wed Mar 03, 2010 4:45 pm

Thank you. It was very informativ anyway.
But unluckily - after solving this Problem - a new one showed up.

I have a concert-details site with several catalog-frontend-reader-modules but also a catalog-reference-modul.
This reference modul creates a link to the festival in which the concerts is happening. everything working.
Buuuuuuuuuuuut, once I edit a Concert and accidently click the checkbox and save: voila, the reference module in the frontend is loaded pointing to a festival - even though the concert is not part of a festival.

well, this is puzzeling me. how can i get my code working there?

at the moment the template for the reference-module looks like this:

Code: Select all
<?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="link3">
<a href="<?php echo $entry['url']; ?>"><?php echo $entry['data']['festival_name']['value']; ?></a>
</div>


<?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>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>

<?php else: ?>
<p class="info">Für diesen Termin ist im Backend kein Veranstalter ausgewählt.</p>
<?php endif; ?>

I tried this already
Code: Select all
<div id="link3">
<?php if ($entry['data']['veranstalter_festival_check']['raw']):?>
<a href="<?php echo $entry['url']; ?>"><?php echo $entry['data']['festival_name']['value']; ?></a>
<?php endif; ?>
</div>

no success! :-(

do you think you can solve this one?
User avatar
valentin
User
 
Posts: 75
Joined: Mon Jul 13, 2009 4:04 pm

Re: Checkbox Items Visibility in Frontend

Postby scare » Wed Mar 03, 2010 5:13 pm

I assume this code creates the links, right?
Code: Select all
<div id="link3">
<a href="<?php echo $entry['url']; ?>"><?php echo $entry['data']['festival_name']['value']; ?></a>
</div>

I would recommend putting <?php var_dump($entry['data']); ?> there to see if veranstalter_festival_check is included there. If it is, just change it to something like
Code: Select all
<div id="link3">
<?php if($entry['data']['veranstalter_festival_check']['raw']): ?>
<a href="<?php echo $entry['url']; ?>"><?php echo $entry['data']['festival_name']['value']; ?></a>
<?php endif; ?>
</div>

Edit: OK, so I should read more carefully. Please post here output of <?php var_dump($entry['data']); ?>
S.C.A.R.E
User avatar
scare
User
 
Posts: 61
Joined: Fri Jun 19, 2009 7:19 pm
Location: Kosice, Slovakia

Re: Checkbox Items Visibility in Frontend

Postby valentin » Wed Mar 03, 2010 5:23 pm

as i´ve said. this was my initial idea. but the code didn´t work.
it also seems that there is no possibility to include [veranstalter_festival_check] in the reference module...

it´s quite tricky? isn´t it?
User avatar
valentin
User
 
Posts: 75
Joined: Mon Jul 13, 2009 4:04 pm

Re: Checkbox Items Visibility in Frontend

Postby scare » Wed Mar 03, 2010 5:32 pm

I can see in the source code of catalog reference module that there should be field called 'Visible Fields'. Can you see something like this (in BE)? What version of Catalog do you use?
S.C.A.R.E
User avatar
scare
User
 
Posts: 61
Joined: Fri Jun 19, 2009 7:19 pm
Location: Kosice, Slovakia

Re: Checkbox Items Visibility in Frontend

Postby valentin » Wed Mar 03, 2010 5:38 pm

Indeed, there is a field called "visible fields" - but the problem is that the fields that can be activated here are fields from the catalog "festivals" not from the catalog "concerts".
in other words, none of that fields is the [veranstalter_festival_check].

catalog 0.3.6 stable - Build 23
catalog_ext 0.8.9 stable - Build 23
User avatar
valentin
User
 
Posts: 75
Joined: Mon Jul 13, 2009 4:04 pm

Re: Checkbox Items Visibility in Frontend

Postby scare » Wed Mar 03, 2010 7:00 pm

I would include code to generate the link to catalog reader template. I don't see any other solution.
S.C.A.R.E
User avatar
scare
User
 
Posts: 61
Joined: Fri Jun 19, 2009 7:19 pm
Location: Kosice, Slovakia

Previous

Return to catalog

Who is online

Users browsing this forum: No registered users