Keyword

Change Readmore Link

  • Kory Mitchell
  • Kory Mitchell's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125064 by Kory Mitchell
Change Readmore Link was created by Kory Mitchell
Hi,

I'd like to change the readmore link to direct to a pdf I have stored. For instance, www.busyteacherresources.com/files/pdf/example-5.pdf.

I have found the code that controls it on category_item.php. It is:

<!-- Item "read more..." link -->
<div class="catItemReadMore">
<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
<?php echo JText::_('K2_READ_MORE'); ?>
</a>
</div>
<?php endif; ?>

I have created an extra field and entered location of the pdf for the item. For example, /files/pdf/example-5.pdf.

Unfortunately, I'm not that good with php.

Does anyone know a good way to rewrite the code above to either reference that extra field, or, I could just make a new field in the db itself and enter the link or file location there.

Thanks in advance.

Kory

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125065 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Change Readmore Link
Hi Kory,

Instead of rewriting or making a new field in the db, i believe it would be easier if you use the attachment and attach you pdf file there. Then in the category configuration -> Item view options in category listings -> Set Attachment to Show.

K2 Rocks \m/

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

  • Kory Mitchell
  • Kory Mitchell's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125066 by Kory Mitchell
Replied by Kory Mitchell on topic Re: Change Readmore Link
To make sure I'm clear, I am going outside of the download link and just want to show the PDF in browser. Embedding hasn't been working on iPhone.

I'm not at computer to check your recommendation, but wanted to clarify.

Thanks.

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago - 10 years 7 months ago #125067 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Change Readmore Link
OK, the attachment method will make the file to be downloaded.

In this case, you need to provide a full url path to the pdf file in the extrafields link value.
					
K2 Rocks \m/

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

  • Kory Mitchell
  • Kory Mitchell's Avatar Topic Author
  • Offline
  • New Member
More
10 years 7 months ago #125068 by Kory Mitchell
Replied by Kory Mitchell on topic Re: Change Readmore Link
Thanks for the insight.

Do you have a clue how to apply that to pull the field specifically for the item using extra fields?

Thanks again.

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

  • Kannan Naidu Venugopal
  • Kannan Naidu Venugopal's Avatar
  • Offline
  • Platinum Member
  • Aham Brahmasmi
More
10 years 7 months ago #125069 by Kannan Naidu Venugopal
Replied by Kannan Naidu Venugopal on topic Re: Change Readmore Link
You can create an extrafield type link and set it to open in same window. The rest leave it blank. Then when adding new items, set the link value and link text value there.

K2 Rocks \m/

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


Powered by Kunena Forum