COMMUNITY FORUM
Override mod_k2_content to show category image
- Kelsey Brookes
-
Topic Author
- Offline
- Elite Member
Less
More
7 years 11 months ago #162152
by Kelsey Brookes
Override mod_k2_content to show category image was created by Kelsey Brookes
Hi there,
I've got a use-case where I want to array the intro-texts of multiple articles in the same category around a single image, which would sit in the centre of two columns.
My thought would be that I would add the image into the category image (or category description) and in the override manually call the image for the selected category. There would only ever be one category selected for this specific type of module.
Any tips for going about this?
K
I've got a use-case where I want to array the intro-texts of multiple articles in the same category around a single image, which would sit in the centre of two columns.
My thought would be that I would add the image into the category image (or category description) and in the override manually call the image for the selected category. There would only ever be one category selected for this specific type of module.
Any tips for going about this?
K
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 11 months ago #162162
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Override mod_k2_content to show category image
I would approach this with a file_exists() check.
Since the category's image is pretty much stored in the same location and has a certain pattern for its URL (id.file_extension), I would check if that file exists and print some HTML code.
Since the category's image is pretty much stored in the same location and has a certain pattern for its URL (id.file_extension), I would check if that file exists and print some HTML code.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Kelsey Brookes
-
Topic Author
- Offline
- Elite Member
7 years 11 months ago #162174
by Kelsey Brookes
Replied by Kelsey Brookes on topic Override mod_k2_content to show category image
Thanks Krikor, that actually gives me a better idea.
I wanted these to be transparent 24bit pngs anyway, so instead I'll get the category-alias, and do a file_exists() check to see if I've placed an image in a directory that's named the same as the category alias.
Best of both worlds.
Thanks for the direction.
I wanted these to be transparent 24bit pngs anyway, so instead I'll get the category-alias, and do a file_exists() check to see if I've placed an image in a directory that's named the same as the category alias.
Best of both worlds.
Thanks for the direction.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
7 years 10 months ago #162178
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Override mod_k2_content to show category image
Nice one Kelsey :)
Best of luck with your project!
Best of luck with your project!
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.