Keyword

Can I add files other than images into item body?

More
10 years 8 months ago #123614 by lee
I am building a site that will contain a large number of links to PDF files, and would prefer for my client to have the ability to upload the PDFs from within the Item body itself, rather than upload to the media directory separately and then create a link. (I do not want to add as an attachment, but rather as a text link on the page). Is that possible, or is there an extension/customization that will allow it?

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123615 by Yiota
Hello,

You can use K2's attachment functionality. The client can click on the appropriate tab inside the item and upload/select from the server already existing pdf and add it to the item. In the frontend a link of the pdf will show under the text area in order for the user to download it.

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

More
10 years 8 months ago #123616 by lee
As I said, I really don't want to add them as attachments. However, if that is my only option, is there a way for me to have them display on separate lines? Right now they are displayed on one line, and I need them to stand out as a vertical list.

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123617 by Yiota
How do you want them to display?
There is also the option to set them up as extrafields and add them there.

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

More
10 years 8 months ago #123618 by lee
I really want the ability to upload a PDF, and list it within the body of the page, and not as an attachment. I want users to be able to click and open them (instead of just downloading). I can accomplish this by manually uploading files by ftp and linking them, but was hoping to streamline this process for my client.

As an observation I find NO real documentation/instructions on K2, so am really struggling with learning how to use it. Extra Fields, for instance... I can't find any instructions, and my attempts at figuring it out on my own have failed. (I created an extra field and a category for it, but when I click Extra Fields within an item, it says Please select a category first to retrieve its related "Extra Fields"... , but gives me no way to do this).

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

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123619 by Yiota
First you need to assign your extra field to a specific extra field group. Then assign this group to the category you need it to show. Even if that category inherits parameters from another one you still need to set the extra field group to that one as well.

Have you watched these videos: getk2.org/documentation/k2class2012
I think they might help you.

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

More
10 years 5 months ago #123620 by Florian
I would like to display attachments in separate lines aswell! If you have more than 1 it really looks messy.
In addition a preview for downloads would be great! Is something like that possible?

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

More
10 years 5 months ago #123621 by Lefteris
@Florian

Hi. Everything is possible. First read getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates. Then if you are familiar with HTML you will be able to alter the markup as you wish. If not, you need to hire a developer to do it for you. If you need something more simple to display each attachment in different row just use:
.itemAttachments li {display : block; }

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

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

More
10 years 5 months ago - 10 years 5 months ago #123622 by Florian
@lefteris: thanks! I am willing and almost capable :silly: to change this myself.
In components/com_k2/templates/default/item.php Line 376 I find the section about attachments and would love to insert a <br> to have each attachment in a seperate line.
But I guess it ain't that simple :( . Can you give me a hint? :dry:
<?php if($this->item->params->get('itemAttachments') && count($this->item->attachments)): ?>
	  <!-- Item attachments -->
	  <div class="itemAttachments">
		  <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
		  <ul class="itemAttachmentsBlock">
		    <?php foreach ($this->item->attachments as $attachment): ?>
		    <li>
			    <a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?><br></a>
				<?php if($this->item->params->get('itemAttachmentsCounter')): ?>
				<span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
			    <?php endif; ?>
		    </li>
		    <?php endforeach; ?>
		  </ul>
	  </div>
	  <?php endif; ?>

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

More
10 years 5 months ago #123623 by Lefteris
@Florian

You cannot insert a line break between list tags. It will produce invalid HTML markup. So it's better to do it with the CSS code i gave you.

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