Building a native Joomla 3.1 component with refereing com_weblinks component - joomla

I'm going to develop joomla 3.1 component.
I have checked lend tutorial. And some people ask us to go through com_weblinks component which is fully written in new MVC style.
Can you please explain img and alt attribute in menu tag and its contents submenu section in weblinks.xml.
And also can you explain link in com_weblinks_categories (option=com_categories&extension=com_weblinks)? How it work? What is the purpose of extension parameter?
<submenu>
<!--
Note that all & must be escaped to & for the file to be valid
XML and be parsed by the installer
-->
<menu link="option=com_weblinks" view="links" img="class:weblinks"
alt="Weblinks/Links">com_weblinks_links</menu>
<menu link="option=com_categories&extension=com_weblinks"
view="categories" img="class:weblinks-cat" alt="Weblinks/Categories">com_weblinks_categories</menu>
</submenu>
And also anyone explain this check condition and parameters and its pattern in controller.php
$this->checkEditId('com_weblinks.edit.weblink', $id)
Thanks a lot

When it comes to articles, banners, weblinks, newsfeed, contacts etc, they use categories. The categories component is not only used for articles but all of the mentioned above. So when you go to view the weblinks, the URL will be option=com_weblinks however when viewing the category, it will use the parent component that's used for it option=com_categories. The child extension is then defined after like so:
option=com_categories&extension=com_weblink
As for the checkEditID function, have a look at this. It's basically a method to check whether or not the ID is in the edit list.
If you look on the Joomla 2.5 menu, you will see small icons on the left hand side of each menu item which I believe img="class:weblinks-cat" is supposed to be used for, however they don't show on Joomla 3.1. I'm not sure why but can always find out why.

Weblinks is most definitely not written in the newest mvc style used by Lendr, if you are coming from 1.5 it is written in the style you should use for 2.5. That style (now known as legacy) also works in J3, but if you extend the base classes you need to rename them.

Related

Joomla 3 Article alternative layout

I've created an alternative layout for one of my articles which can be applied successfully, but as has been highlighted in various forums: if you view the article using the Single Article menu type the alternative layout doesn't get applied because of an XML override.
I have a Joomla site that is setup for Sales and Support where the article info such as date, hits etc is useful but on the marketing side none of that is needed, hence an alternative layout would work well.
I want to know how to enable my alternative layout using the Single Article menu type - I've already got the layout how I want it (testing it by having it overwrite default.php) but want to set it up as marketing.php instead and only have it applied to what is needed.
You're probably not going to like this answer because you have already written you're alternate view. If you were rewriting it to begin with, why would you not write in a way that the side bar parameters (date, hits, ect) are within a container that is only loaded conditionally. This way you would only have one view to worry about and a lot less headaches.

visually enhanced joomla 2.5 List of Categories component (Default is ugly)

I have a menu item that loads a List of Categories.
The problem is that I don´t know if there is a visually enhaced component other than the default one.
Could you please point me to the right direction
I am using Joomla 2.5
Printscreen: http://snag.gy/pEQsb.jpg
Just to add a link to the suggestion from Marko D about template overrides (which would be the correct answer):
http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core and http://docs.joomla.org/Understanding_Output_Overrides explains how the template overrides work
This is indeed the simplest way to adjust how the list is created. And of course using CSS within your template.

How to display the “Menu Title” in Joomla 2.5

I’m trying to display the menu title text (example “Home”) in the header area of my Joomla 2.5 website.
Joomla’s default (when activated) is to place it in the Component area.
I’m not sure the best way to accomplish this. By default Joomla wraps the menu title with an H1 tag but doesn’t wrap it with a div and class.
The ways I’ve thought might be best to do this are:
Somehow wrap all menu titles with a div and class so I could reposition them up into the header with css .
Add some php code to my template. Something like:
php
$menuTitle = $this->params->get(‘fieldNameOfMenuTitle’);
php
echo = $menuTitle;
Any ideas, suggestions, or answers would greatly appreciated
Thanks
Never found an exact answer but found a work around.
Used a modified version of the below demo/plug-in to create a custom field (named it: "Title that displays on the Web Page") in the articles menu. By default, the table that is created and displayed in the web page is in the component area and is wrapped in a w/ a class. Repositioned the with CSS up into the header/banner area.
http://docs.joomla.org/Adding_custom_fields_to_the_article_component

Joomla 1.5 / Modification of YooTheme "ZOO" Component

I'll start out by mentioning that there is a developer forum for Zoo and I have used it already. My purpose posting here is that I typically get a thorough answer within minutes or hours at SO, whereas the responses on dev forums can be slow or non-existent due to the smaller population base.
My question regards Yootheme's ZOO 2.3.2. By default, a product "Frontpage" appears to have a "Categories" box rendered on top of the items. If one turns off all the available options in Frontpage/Template configuration (hide Titles, Count, Descriptions, etc.), an empty box still remains on top of the items.
I've been able to manually remove the box in its entirety by addressing the following file:
media/zoo/applications/product/templates/default/frontpage.php, and commenting out lines 84-92:
<!-- <?php
// render categories
if ($this->category->childrenHaveItems()) {
$categoriestitle = $this->application->getParams()->get('content.categories_title');
echo $this->partial('categories', compact('categoriestitle'));
}
?> -->
Seems like there should be a more eloquent way of doing this on the admin backend, but I couldn't find one. Am I missing something or is my solution the best one?
ZOO is designed to easily be able to modify the built in templates to suit your needs. ZOO templates are meant to be overridden much like Joomla uses template overrides. Rather than editing the default template, you simply create a new template that does what you want it to. The default template should not be changed.
Here is the documentation on ZOO templates - http://www.yootheme.com/docs/home/item/create-a-new-template
Rather than edit the file you mention above, you make a new template here -
media/zoo/applications/product/templates/YOUR-TEMPLATE-NAME/frontpage.php
Then do all the changing you want without messing up the default.
There is an easier way: First, you must identify what calls the item called "frontpage". In PURE yootheme at least it is called from "home" in the "mainmenu". So click "home" buton of the mainmenu, then over the right menu "Parameters(Basic)" you just chose "-select aplication-" instead "frontpage" and that's it.The Frontpage and its "box" are now gone. At least it works for me.

Custom section/category viewing in Joomla

I have written some modules to have it look nicely. What I need now is to re-order Joomla's standard viewing of the content. I have looked into com_content, and my first idea was to write my own component for it. But now I realized it would be about 90% a copy of com_content.
The problem is: When you open a link to a section, com_content views a list of the categories. But I want a list of the articles in category News of each viewed, and a link to every article in category Infos on the menu to the left. And of course, view each on click.
Is there a way to achieve that without writing an own component? Or would it be advisable to customise com_content to my needs? I want this done with a minimum of fuss and complexity.
You can override components view-templates in your theme.
In your case, for articles: Articles are part of the content component. components/com_content/views/article/tmpl/default.php is the default view of an article.
To override it copy the file to templates\<yourtheme>\html\com_content\article/default.php.
As an example, see the default theme ja_purity or beez, which also override it.
That way, you will only change the layout and only for your theme. The component will stay in tact and updates will not be as complicated as otherwise.
The visible components on your website are called modules. See the modules section in the admin section. The category-view is one of the default modules. There is also a module to display a list of categories (AFAIK). That is what you want, right? The modules listed in the module section are not all available ones, but all that are created. You can create a new one and set its type to the category-list for example, and define in what block of the theme it should display.
If you want to do your own Module, do so. Code it, then add it in your admin section and you’re done.

Resources