FREELessons: 35Length: 7.7 hours

Next lesson playing in 5 seconds

  • Overview
  • Transcript

6.6 NewsFeed Component

Hi, guys. Welcome back to a beginner's guide to using Joomla. And in this lesson, we want to carry on learning about the News Feed component. So, now we've discovered the menu item types that relate to the News Feed's component. What I'd like to do is take a look at the modules that relate to this component. So instead of us rendering a News Feed on a page like we have here. We could have the News Feed render as a module in a certain position within our template. So for this next part, we're gonna take a look at modules that relate to RSS feeds. So now, I'm gonna drop down the extensions menu and go to the module manager. From here, we can create a new module, and we need to select which module type we'd like so that it generates a certain piece of content. So, I'm gonna select the module type of feed display. This will again allow me to link to a feed URL and then present the data to the user as a module rather than an entire page. So the first thing is to provide a title for the module, then we need to provide a feed URL where the module will take the raw data and interpret it to the user. Then we need to say whether we want this to be a right to left feed. So if this feed is for example written in Arabic, Arabic is right to left. However, as our is English, we're gonna leave that set to no, which is left to right. Also, we can say whether we want to show the feed title, not the module title, but the feed title, the feed description, the feed image, and we can also limit how many feed items are rendered, there could be over 100 items within a feed. So ideally, as this is in the side bar with limited space, we want to limit the amount of feed items. On top of that, we can also say whether we want to show the item description. So for each one of those items, we're gonna show the description for those items and also we can limit the word count. Now, if the word count is left at zero, it will render the entire item's description. Again, this can cause problems with limited space so we'll come back to that in just a second. Then, again, we have the standard, typical options for a module, such as would you like to share the title. What position should the module be in, the status, start and finish publishing dates, and also the viewing access level, the ordering within that position. We can assign a language to the module and also provide a note that's viewable on the back end. Then, we have the menu assignment again, with all modules, we need to assign what page this module will generate its code on. So through the menu items, we will assign this module, and we're gonna assign this module to all pages. Then we have the module permission, so which user groups are allowed to delete this particular module, edit the module, and edit the state of the module, so just published, unpublished and so forth. Then we have some advanced settings, again, these are typical advanced settings allowing you to choose what type of tags there are and also the type of styling and layout, and custom classes, and so on and so forth. So let's now save and close this, and preview it on the front end. So here is my RSS display module. And it's doing exactly what I've asked it to do. It's showing the title of the module, the title of the RSS feed. And there is no description for the RSS feed but if it did, it would show up. And then we have the three items, so there's one, two, and three, and they're showing the full description of the items. Now, that's the same amount of content that we have here on the main page, that's too much content for the sidebar. So, we're gonna have to go in and limit the amount of words being used within the module. So, we need to go back, take a look at the RSS blog module, and then we need to set the word count to possibly 100. Go ahead and Save that, and then we can preview it on the front end. So, if I hit Refresh now, there's a lot less text being displayed which is more suited for such a small area. So, now that we've discovered that Joomla can interpret raw data and display it to the user, either in a modular format or on an entire page. What about generating RSS feeds for content within our Joomla site? Well, if we take a look at the module lists, we can add in a new module. And then, we can go down and add in a syndication feeds module. This would generate a RSS feed when it can, depending upon the page that it is displayed. Now we actually already have this module so we can now take a look at the syndication module. This is exactly the same type of module, syndication feeds, and it generates an RSS feed. So, if we take a look at the module options, they're fairly basic. We can say whether we want to show some display text which is affecting the text of the link, but it's not a big deal, so I could say generate RSS feed, and then we can choose the feed format, so you can have RSS 2.0 or Atom 1.0. We need to then assign the position, so that's gonna be position seven. And then, we can take a look at the menu assignment as well. So, this module is assigned to all pages on our site but this module doesn't show up on all pages, and there's a reason for this. So if we scooch on over and go to Google Chrome, and on the front end of our Joomla installation, on the homepage. And if we scroll down, we can see that there is a link to an RSS feed. And there is our display text, and when we click on that, it will give us an RSS feed for the content that is on this page. Now, this module is smart, meaning it looks at the content of the page and it detects whether the content can be itemized. For example, you'll notice a repetitive trend with the content that's on this page. You have the article's title, you have a link to the article, you have details about the article, and also you have a little bit of information from the article. And that's repeated over and over, and over again. So, this repetitive format can be itemized into an RSS feed. And that's where this module shows up to give you the link to the RSS feed in question like so. Now, this module would not appear on let's say a single article page. If we click on that and then scroll down the module isn't showing up because the data on this page is just relating to one unique article and the data is not repetitive in any way. So then, the module is disabled for this page because there's no need to generate an RSS feed. Now, this isn't just limited to articles, any type of data that's repetitive. So for example, I'm going to re-enable a menu item under my test menu which is the admins contacts category page. I'm gonna go ahead and enable it and then we're gonna refresh the front end, like so. And then, we're gonna click on the admin's contacts category page. And you'll notice again, we have this repetitive data. So we have the contact's name, a link to the contact's page, and so on and so forth, and this data is repetitive, and we scroll down. It says generate an RSS feed, click the link and now you'll notice each item within this feed is the individual that's listed on the page. So this feed generator is very, very clever in understanding what can be turned into an RSS feed and what should not be turned into an RSS feed, and that is done automatically. And if I didn't want the RSS feed being generated for the admin's contacts category page, I can drop down extensions, go to the module manager, syndication, and inside of there, we can take a look at the menu assignment and then we can say only on pages selected. We can take a look at all the different pages and then unassigned the module on the admins contacts menu item which will lead us to the admins contact category page, I can Save and close that. And now, if we take a look at this page and hit Refresh, it will disappear because that module is no longer being assigned to that page. Now finally, to finish off the News Feed's component, we need to take a look at some of those global configurations. So again, we could go into System, or we could go to the component itself. So News Feed, and then click on Options to get the global configurations for the News Feed component. So these options are for a single News Feed being displayed on a page. And, the first thing we can do is take a look at the default layout. Now currently, there's only one layout that I can choose from and that's the layout from the component itself. Then, we can enable version control by saying yes to save history and we can set a maximum number of versions, so five maximum, and then the versions start overwriting themselves every time we save a new version of the News Feed Item. Then we can say whether or not we want to show the feed images, so the first and secondary image. If you wanna show the feed description and also if you wanna show the content for each feed item. You can then set the character count for each feed item's content. You can also change the feed display order, so most recent items first of oldest items first. You can set the default float for the first image and also for the secondary image as well. And then, we can also show any tags associated with the News Feed. Please do note, these options can be overwritten when it comes to individual News Feed items. You just need to click on the News Feed item, go to the Display tab, and you can adjust the options there. And on top of that, you can also set the number of articles or Items rendered, the cache time, and also the language direction as well. Then we can take a look at the category options. These options are for menu items that link directly to a News Feed category. So firstly, we can choose a default layout for this component to use for our category pages. At the moment, we only have one layout provided by the component. We can also show or hide the category title, description, image, and also we can set how many levels we'd like to render in terms of subcategories. Now for this next part, I'm gonna go over to the back end again with the News Feed categories. And I'm gonna create a subcategory for the News Feed main category, and then go ahead and Save it. So, once we've done that, we get the subcategory's heading, but the problem is, it's still not showing that subcategory. And that's because its class is an empty category so we need to show empty categories. Then, we can show and hide the subcategories descriptions, the number of feeds associated with a subcategory, and also show any tags associated with a News Feed category. All these options here are the defaults for the displayment of category pages within the News Feed, but they can be overwritten by the menu items that link directly to a News Feed category. Next stuff, we have the default options for the list categories page. The first option is to show the top level category description. Now, on the menu Item, I set the top level category to be root. So, we can provide a top level category description via the menu item and then have it displayed on the page. And then, I can select how many subcategory levels I'd like to render. Now, we are missing a few categories so I need to show the empty categories. Now, even though I said show empty categories, I'm still missing the subcat under the News Feed main category. So what I need to do is manually set the subcategory levels. Again, it's a bug in Joomla, and I'm gonna set that to two so that the subcategory renders. And then, we can decided whether we want to show subcategory descriptions and also the number of feeds associated with the subcategory. And again, we can overwrite all of these options via the menu item that lists out multiple News Feed categories. Now, we can take a look at the default options for list layouts. So, these options are for any page within the News Feed component that has a list layout that is being generated. So in our case, I'm just gonna take the News Feed main category page. From here, we can show and hide the filter field, show and hide the display drop down which allows us to select how many records we'd like to show in a single page. Also, we can show table headings, show the number of articles associated with the News Feed, show the feed links also whether we want to show pagination and also pagination result, so one page of 500 pages and so forth. And you can overwrite the list layouts, default options, through the menu items that produce a layout that is in the list format. And then finally, we have the permissions of the component. For example, who gets to configure this component like we're doing here with the global configurations. Who has access to it, through the administrator interface, who can create News Feed and News Feed categories, who can delete items within the extension, edit, edit state. And also, are they allowed to edit their own News Feds and news feed categories, but not anyone else. So thank you for watching me in this lesson. And please join me in the next lesson where we'll be taking a look at a few more components.

Back to the top