- Posts: 2
COMMUNITY FORUM
K2 Attachments
- Luis Ordonez
-
Topic Author
- Offline
- New Member
Less
More
9 years 1 month ago - 9 years 1 month ago #151978
by Luis Ordonez
K2 Attachments was created by Luis Ordonez
Hello,
I was wondering does any one have a better way to display K2 Attachments in my K2 items. I just need a way for the attachments to be separated on each line or a little cleaner look.
Here is how it looks now
www.napswhatsinitforme.com/k2-categories/item/500-nonbargaining-promotional-pay-policy-revisions
Thank you
I was wondering does any one have a better way to display K2 Attachments in my K2 items. I just need a way for the attachments to be separated on each line or a little cleaner look.
Here is how it looks now
www.napswhatsinitforme.com/k2-categories/item/500-nonbargaining-promotional-pay-policy-revisions
Thank you
Last edit: 9 years 1 month ago by Luis Ordonez.
Please Log in or Create an account to join the conversation.
- Javi Mata
-
- Offline
- Senior Member
9 years 1 month ago #151985
by Javi Mata
Twitter: @Javi_Mata
Web: www.javimata.com
Replied by Javi Mata on topic K2 Attachments
in each attachment can put a title, and edit the module
in the module you can see some like this:
<?php if($params->get('itemAttachments') && count($item->attachments)): ?>
<div class="moduleAttachments">
<?php foreach ($item->attachments as $attachment): ?>
<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
you can add a ul list or <br> after the </a>
or can use CSS with some like:
.moduleAttachments a { display:block; }
in the module you can see some like this:
<?php if($params->get('itemAttachments') && count($item->attachments)): ?>
<div class="moduleAttachments">
<?php foreach ($item->attachments as $attachment): ?>
<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
you can add a ul list or <br> after the </a>
or can use CSS with some like:
.moduleAttachments a { display:block; }
Twitter: @Javi_Mata
Web: www.javimata.com
Please Log in or Create an account to join the conversation.
- Luis Ordonez
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 2
9 years 1 month ago #151991
by Luis Ordonez
Replied by Luis Ordonez on topic K2 Attachments
Thank you Javi Mata, I really appreciate the help.
What file and where is it located where I can edit the module?
Thank you
What file and where is it located where I can edit the module?
Thank you
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 1 month ago #152021
by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Attachments
Kudos Javi once more :)
Just make sure to use overrides instead of editing core files.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Just make sure to use overrides instead of editing core files.
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
Please Log in or Create an account to join the conversation.