Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

K2 items Title Tag shows on Empty SIG Pro Gallery

More
13 years 7 months ago #40269 by mcweb
Hi I have Joomla 1.5.21, Simple Image Gallery PRO v2.0.5 and K2 2.4.1 installed.

how can I remove the h2 title and the empty itemImageGallery container when there is no gallery uploaded for a specific item?

the item.php source for the simple gallery looks like this:

<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
  <!-- Item image gallery -->
  <a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
  <h2><?php echo JText::_('Image Gallery'); ?></h2>
  <div class="itemImageGallery">
      <?php echo $this->item->gallery; ?>
  </div>
  <?php endif; ?>

The output for an item with NO gallery uploaded is still:
span class="nodeTag">a id="itemImageGalleryAnchor" name="itemImageGalleryAnchor"> </a>
span class="nodeTag">h2>Title</h2>
span class="nodeTag">div class="itemImageGallery"> </div

The !empty function obviously does not work here I think.
Any ideas on that?

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
13 years 7 months ago #40270 by Yiota
If you are using a template from a template provider maybe you should ask them to help you with it, if not, provide a link to your site to take a look.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40271 by mcweb

If you are using a template from a template provider maybe you should ask them to help you with it, if not, provide a link to your site to take a look.


tell me which source u want to see?
the k2 part of that site is protected.
but you would only see the stuff i already posted:

the problematic part is

<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
  <!-- Item image gallery -->
  <a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
  <h2><?php echo JText::_('Image Gallery'); ?></h2>
  <div class="itemImageGallery">
      <?php echo $this->item->gallery; ?>
  </div>
  <?php endif; ?>

found in here:
joomla\templates\rt_gantry_j15\html\com_k2\templates\myk2template\item.php

here is the specific item.php (could not upload zip because your upload folder is full)
pastebin.com/y8XdweA7

somehow the !empty does not work
the item.php is actually the one which came with k2 i just did some small modifications

the gallery title is generated although there is no gallery set up for the article.
this is the generated (useless) html output:
...
span class="nodeTag">a id="itemImageGalleryAnchor" name="itemImageGalleryAnchor"> </a>
span class="nodeTag">h2>Title</h2>
span class="nodeTag">div class="itemImageGallery"> </div>
...

thanks for any help

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40272 by aap411vm
Hi,

i have the same problem. And try to figure this out. But this is the stranged thing..

What I have done so far:

1. check the database values in k2-items. See whats in there. if empty he has a value of NULL.

if ($this->item->gallery == NULL)
{
echo "test";
}

Gives no response...

Make it a bit more simples.. Make the database value 1

Do the check again:

if ($this->item->gallery == 1)
{
echo "test";
}

There is a response.. So it does communicate with the right fields.

Lets make de database field a string: test

if ($this->item->gallery == 'test')
{
echo "test";
}

Nothing again.... I have lost it. When I just echo the $this->item->gallery

It gives me a response of the database value test.

Why doesn't the if statement work?? Any advice would be great!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40273 by Katia
A link to your site please.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40274 by aap411vm
www.rienkrienksmusic.nl/index.php

Can give you the source codes as well.. If you look under albums / pierre you will see the extra empty image field.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40275 by Katia
Pm me access to your super admin please.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #40276 by Katia
Check your pms please.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #40277 by mcweb
any solution?
::)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum