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.

''Read More..'' link to module?

  • Stephen B. Kiely-Jones
  • Stephen B. Kiely-Jones's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #137693 by Stephen B. Kiely-Jones
''Read More..'' link to module? was created by Stephen B. Kiely-Jones
Hi

I am using Tordea for a cat breeding website. I have added 6 images for the top slider and want slide 6 to connect to the Contact Us form. I have set this up on the MENU and it works but the ''Read More'' on slide 6 goes to a page (item).

The site is at: www.idxa.co.uk/ardeevan2014

Any suggestions gratefully received.

Many thanks

Stephen

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

More
10 years 9 months ago #137694 by Yiota
Replied by Yiota on topic ''Read More..'' link to module?
The slideshow works by default with K2 items. Therefore, you have two options. 1) is to just use the item the slide is currently linking to and put the contact us link in there, kind of pointless to walk your visitor through 2 clicks in order to see the contact, but it's an option and 2) you can modify the default.php file of the slideshow module located in templates/toreda/html/mod_k2_content/Slideshow and with a check for the proper slide add the menu link you have made as the title's and read more link. You can use the custom link from the module to carry the correct link of the contact form and use this one in the module's code.

Let me know if you need further help on the second option.

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

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

  • Stephen B. Kiely-Jones
  • Stephen B. Kiely-Jones's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #137695 by Stephen B. Kiely-Jones
Replied by Stephen B. Kiely-Jones on topic ''Read More..'' link to module?
Hi Yiota

Thanks for this reply.

I will try option 2 but my skills in editing PHP files are really non-existent.

I am learning as I build. What do I do once I am in the PHP file?

Many thanks

Stephen

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

More
10 years 9 months ago #137696 by Yiota
Replied by Yiota on topic ''Read More..'' link to module?
OK.

First you need to locate this code

<?php if($params->get('itemCustomLink')): ?>
<a class="moduleCustomLink" href="<?php echo $params->get('itemCustomLinkURL'); ?>" title="<?php echo K2HelperUtilities::cleanHtml($itemCustomLinkTitle); ?>"><?php echo $itemCustomLinkTitle; ?></a>
<?php endif; ?>

and comment it out.

Now all you have to do is to create a conditional statement that will apply to that specific 6th slide.

Replace the title link
<?php if($params->get('itemTitle')): ?>
    	      <h2 class="slideTitle">
    	      	<a class="moduleItemTitle" href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>
    	      </h2>
    	      <?php endif; ?>
and the read more link
<?php if($params->get('itemReadMore') && $item->fulltext): ?>
            <a class="moduleItemReadMore btn transparent" href="<?php echo $item->link; ?>" title="<?php echo JText::_('K2_READ_MORE'); ?>">
              <span><?php echo JText::_('K2_READ_MORE'); ?></span>
            </a>
            <?php endif; ?>
with these block of codes one for each one
<?php if($params->get('itemTitle')): ?>
    	      <h2 class="slideTitle">
    	      	<a class="moduleItemTitle" href="<?php if($key+1==6) echo $params->get('itemCustomLinkURL'); else echo $item->link; ?>"><?php echo $item->title; ?></a>
    	      </h2>
    	      <?php endif; ?>
<?php if($params->get('itemReadMore') && $item->fulltext): ?>
            <a class="moduleItemReadMore btn transparent" href="<?php if($key+1==6) echo $params->get('itemCustomLinkURL'); else echo $item->link; ?>" title="<?php echo JText::_('K2_READ_MORE'); ?>">
              <span><?php echo JText::_('K2_READ_MORE'); ?></span>
            </a>
            <?php endif; ?>

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

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

  • Stephen B. Kiely-Jones
  • Stephen B. Kiely-Jones's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #137697 by Stephen B. Kiely-Jones
Replied by Stephen B. Kiely-Jones on topic ''Read More..'' link to module?
You are EXCELLENT !
Thanks so much. I will try this tonight and let you know how it goes.

Many thanks

Stephen

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

More
10 years 9 months ago #137698 by Yiota
Replied by Yiota on topic ''Read More..'' link to module?
OK. Let me know.

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

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

  • Stephen B. Kiely-Jones
  • Stephen B. Kiely-Jones's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #137699 by Stephen B. Kiely-Jones
Replied by Stephen B. Kiely-Jones on topic ''Read More..'' link to module?
Hi Yiota

I have applied the new PHP as you have described but am now lost as to where the Title and Read More link for slide 6 is so that I can add the link to the Contact Form

Aslo how do I disable the Title link on slide 1 ?

Many thanks

Stephen

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago - 10 years 9 months ago #137700 by Krikor Boghossian
Replied by Krikor Boghossian on topic ''Read More..'' link to module?
Stephen I will need some more feedback from you.
I can provide the code for you but you have to know that this will apply to every 1st slide not that item.

Yiota's code allows you to use the K2 Content's module custom link. This option is located on the bottom of the module's parameters.
<?php if($params->get('itemTitle') && $key !=0): ?>
    	      <h2 class="slideTitle">
    	      	<a class="moduleItemTitle" href="<?php if($key+1==6) echo $params->get('itemCustomLinkURL'); else echo $item->link; ?>"><?php echo $item->title; ?></a>
    	      </h2>
    	      <?php endif; ?>

This will hide the title for the first slide.

Hint: I only added && $key !=0 to Yiota's code.

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

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

  • Stephen B. Kiely-Jones
  • Stephen B. Kiely-Jones's Avatar Topic Author
  • Offline
  • Senior Member
More
10 years 9 months ago #137701 by Stephen B. Kiely-Jones
Replied by Stephen B. Kiely-Jones on topic ''Read More..'' link to module?
Hi Krikor

I really appreciate your help!

I want the first slide to have no working link and the last slide to go to the Contact Us page (menu item) the other slides should still link to their own item pages.

Stephen

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 9 months ago #137702 by Krikor Boghossian
Replied by Krikor Boghossian on topic ''Read More..'' link to module?
Hello Stephen,

For the last slide you have to do what I advised you in my last post. (Module's cusotm link).

Now for disabling the link and showing only the title disregard my last snippet. This will do the trick.
<?php if($params->get('itemTitle')): ?>
<h2 class="slideTitle">
	<?php if($key==0) :?>
	<?php echo $item->title; ?>
	<?php else: ?>
	<a class="moduleItemTitle" href="<?php if($key+1==6) echo $params->get('itemCustomLinkURL'); else echo $item->link; ?>"><?php echo $item->title; ?></a>	<?php endif; ?>	
</h2>
<?php endif; ?>

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

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


Powered by Kunena Forum