Keyword

Problem with display / linking of K2 - Articles on Joomla - Website

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172722 by Joe Madden
Hi,

I'm currently designing a new website, but am having issues with the frontend layout of K2 Articles (using them in Joomla). Imagine the general page layout as given in attachment "P1", where the top image and the intro text are both modules. So, the articles all display well on the page.

But when you open them, they open either on the same page as I already am - cf. Image "P2" (If I choose the menutype connected to the K2 - Category of the linked articles to be "K2" - "Categories" in Joomla) ; OR they open on a new site which is what I want (If I choose the menutype connected to the K2 - Category of the linked artciles to be "JA K2 Filter" - "Items List"), but in this case, the page displaying all the articles of the respective category display the text line "Search results" on top of the articles in the frontend, which I don't want.

What I want is that a new K2 Article appears on a new page if somebody clicks on it, and that no "Search results" text line appears above the articles on the page where they're all displayed (cf. "P3"). Help??
Attachments:

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

More
4 years 8 months ago #172736 by JoomlaWorks
This happens because your frontpage/homepage menu item ID stays the same. In other words, your image & intro modules continue to show because they are assigned to your frontpage menu item and that menu item's ID is not changing when you navigate to a K2 item.

In Joomla we use menu item IDs to differentiate content loaded. In your case, the menu is pointing to a K2 category so when you click on an item, the menu item ID remains the same and K2 displays the item. To bypass that, do the following:

- Make your homepage menu item point e.g. to Joomla's Featured Articles. Make sure you don't have any marked as featured so the output will be empty.
- Below the intro text, add one more module of "K2 Content" type. Use that module as you did with the K2 category before: retrieve K2 items from one or more categories. Make sure this module instance, as well as the homepage image and introtext are shown ONLY on your homepage (from the module menu assignments tab of each module instance).
- Create a new menu item pointing to the K2 category (or categories) with your actual content. This content is what is also retrieved in the "K2 Content" module I mentioned previously. Now, this new menu pointing to K2 categories should appear in your site's menu. If you don't want that, create a new menu in the Joomla backend and just don't call the menu through some menu module.

Now when you click on one of the K2 items in your frontpage, the menu itemID will change and as such, any module that was previously assigned to your frontpage menu item will now NOT show up in your K2 content BECAUSE it has a different menu item ID and BECAUSE the modules are not assigned to that menu item.

Got it?

P.S. This is Joomla stuff really, it's not specifically related to K2. The same thing would happen with Joomla articles as well, only (worse) Joomla articles have their options set in the menu item and not their category, so you can end up with the same article page but different assigned modules or article page options based on HOW you ended up to the given article. This whole menu item IDs thing may seem a mess, but it's actually very powerful if used properly.

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

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172753 by Joe Madden
Thanks so much dude, but still three (probably for you very trivial) questions:

1. When I'm opening the page of the article overview now, one article is displayed per row, with the title left-aligned and the image centered. What I would like to have is three articles per row, ideally with the image centered, but the title too, in each of the thus three columns per row. No matter what I change in the Categories' or the Articles' Options, I can't change the layout. You know where I could do that ?

2. When you're viewing the list of all the articles let's say in german, and switch to another language let's say english via the language switcher, the articles all get displayed in english, that all works nicely. BUT, it is also possible to language-connect K2 Articles ? Meaning that, if you're reading an article in german and click on the the English - Flag in the language switcher, you would get redirected automatically to the same article in English ?

3. The last step you suggested to do (create a new menu, then a new menu item also pointing to the same category as the "K2-content"-type module); is that to optimize the URL ? I ask out of curiosity, because the linkage to the articles worked already previously for me before doing this last step, but the redirection was made via a "component/k2...." - URL, and now it's being redirected via the simple alias of the respectively defined menu item. Is that why you suggested to do this last step, or is there another reason ?

Thanks so much for your help dude really, all this stuff has been an issue for quite some time now. Looking foorward to your next answer. Cheers!

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

More
4 years 8 months ago #172764 by JoomlaWorks
Replying...

1. An article overview does not contain other items, just the item you see. If you mean categories, then how items are presented in what you see is controlled first by the respective K2 category or if you're creating a menu item pointing to multiple categories, some parameters like the grid are controlled by the menu item options.

2. Not out of the box. A plugin is currently being tested for that and will be released in September as part of the K2 Pro suite of extensions. See a preview here: www.nationalopera.gr/en/alternative-stage/es-children-s-performances/item/2250-the-emperor-s-nightingale (language switcher is on the left sidebar).

3. When K2 content is assigned to a menu item, the URLs are indeed simplified. But I did not suggest this change for that. You need different menu items if you need your layout (=modules) to be different across pages/sections.

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

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172766 by Joe Madden
Additional Question: My images of the K2 Articles are not showing up in the initial overview, they only apear once you click on the article. You may know why ? I checked all configurations (K2 articles, K2 categories, K2 modules) and the image is always set to be shown...)

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172767 by Joe Madden
Thanks for that; just saw your reply now. If it may interest you, I figured a way to easily customize the k2 - content module layout for the articles via custom css, after some HOURS of trying to find the right lines. This solution is however quite good I feel, because it even makes the layout responsive for phones or tables, and maintains the three-column structure for smaller screens too. Just make sure you use appropriate image and font sizes:

.intro_css{
width: 100%;
display: block;
float: left;
}
div.k2ItemsBlock ul li{
margin-bottom: 20px;
width: 33.33%;
float:left;
}
div.k2ItemsBlock ul li a.moduleItemTitle{font-size:12px;}
div.k2ItemsBlock{text-align-center}

the two last lines set the font size of an article to 12 (not too big to not cause layout problems on small screens while remaining responsive) and set the title to be centered, respectively.

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

More
4 years 8 months ago #172771 by JoomlaWorks
Again, if you don't see K2 images in some view, they are either hidden in settings (K2 categories, K2 modules etc.), or if you use a 3rd party template, they may not have been included in the template overrides.

As for your CSS example, it would really only make sense if you provided your site's URL, so there is context :)

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

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172774 by Joe Madden
Well I've checked all the settings of everything. Do you may know the custom css code for displaying the images in the articles list / category view? Then I'll just insert that into the custom css, that should do it, no ?

I can only send you the URL by the next week apologies, then we're supposed to publish it :)

Cheers brother!

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172775 by Joe Madden
I found out something more : When I change the settings of the view of the article A via the settings of the category containing the article A, the aspect in the frontend is changed accordingly. However, when I change the settings of the view of the category list of the same category just above, nothing gets adapted in the frontend view. If this may help.

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

  • Joe Madden
  • Joe Madden's Avatar Topic Author
  • Offline
  • New Member
More
4 years 8 months ago #172776 by Joe Madden
All good actually, it was because I said the article's image size to be small; when I set it to "middle" it got displayed -.- hahahha probably some size filter sh**

Cheers buddy, thanks so much for your help! For the CSS-thing, I'll post the URL by the next week in this post if you're interested, lmk.

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


Powered by Kunena Forum