How to show a module in Joomla when it's not a Menu item - joomla

I am trying to show a module, but the article I want to show the module on is not linked to a menu item. Is this possible? Seems like a module can only show when it is a menu item. But I have a ton of articles that are not menu items - so what is easiest way to show the module? Any help would be greatly appreciated.

The way to do this is as follows.
Let's suppose you have a group of articles that you wish to all display the same modules on.
Create a new category using the "category manager" option from the content menu
Ensure all the articles are published into this same category.
Create a new menu which you won't actually ever display anywhere (I like to publish the menu into a module position which is not present in the template)
Add a category blog layout option to this new menu
Now go through each of the modules that you wish to display for the group and add them to the new menu item you have created.
Hope this helps!

This will be my first answer after getting so many help through stackoverflow without being a member.
I will just add something to buzzki's answer. Because i was almost loosing my mind until i figure out how to solve.
If you used an article in a module with an extension like mod_articleasmodule; it adds the aliases of articles on URL of Read More.
Simply change the line;
$link = "index.php?option=com_content&view=article&id=".$item->id.":".$item->alias."&catid=".$item->catid.":".$item->catalias;
to
$link = "index.php?option=com_content&view=article&id=".$item->id."&catid=".$item->catid;
to get the pure URL Link and your menu assigned by MetaMod will work. Also great thanks to buzzki for help.

While the {loadposition xxx} technique is very handy, what it won't do is to put the module into any of the "standard" module positions (e.g. left, right, banner, or whatever your template has).
If you want your module in one of those positions, a great method is to use MetaMod. MetaMod is a placeholder module, that includes other modules inside of itself according to rules that you set up.
So you can set it up with a rule that says, in effect, "if we are on article A, B, C, D or E, display the module".
if ($content_genius->check("article_id = 50, 51, 52, 53, 54")) return XXX;
// replace XXX with the module id to show on those articles
Now, if the number of articles is going to change regularly, you don't want to have to edit the MetaMod to change the list of ids. So another way is to use the Meta Keywords field in the articles to determine whether the module will appear. Then all you have to do is include that keyword on any article you want the module to appear on. Let's say the keyword will be "SHOWMOD".
So in MetaMod you can simply use this:
if ($content_genius->check("article_metakeywords contains SHOWMOD")) return XXX;
// replace XXX with the module id to show on those articles
In that way, the module will appear on every article page where the article contains that meta keyword. And the module position can be any position on the page (wherever the MetaMod is assigned).

Step 1: On the front end of your website, click to the specific article that you want, highlight and copy the URL.
Step 2: Create a menu item, item type is URL and paste your article URL in there. (You can have the menu item be in an unpublished menu i think)
Step 3: Select it from the Menu Items list in the module.

You simply name your module position whatever you want, say 'monkey' where your module offers a 'select position'. You actually type it in. Then in the article you want to place it in, you add
{loadposition monkey}
to any location of your article you want the mod to work in the html editor.

Follow these steps in your joomla site Admin panel:
Go to the module manager, open the desired module and give a unique name in the position field. If you want to use it also at other common position such as left or right, then first create a copy of this module and then for the new copy, create a unique position name. Example: custom1.
Create a new article preferably uncategorized. Give it the name of your module.
In the body area of the article type {loadposition custom1} and save your article.
Create a Menu link to this article in the desired menu. You should select 'Article layout.'
Thats all, your module will now load from the menu link directly.
This has an added advantage of giving you SEO prominance based on the meta info you give for this article.

Related

Joomla - How can I opt one from various modules to display in a position

I am willing to create a logic in which If I can fetch only desirable module in a particular position.
As we know that Joomla displays the module on basis of positions given to modules created, hence there could be several modules for a single position.
Now what If I only want a single module from those modules who has the position, say "positon-1".
Thanks
Each module can be told to be shown only on specific pages. Look in the module settings at the "Menu Assignment" part. There you can set it to show on
all pages
No pages
Only on the pages selected
On all pages except those selected
So you can set a module to show on the homepage in position-1, but on all other pages there is a different module shown on the same position.
Don't position names like position-1, although the example templates shipped with Joomla! do so. Use semantic names for the module positions. Then, within your template, you define, where these positions live.
Now what If I only want a single module from those modules who has ... [a certain] position
That will never happen then. You're going to have a position called search where the serach field is located, and maybe another one called navigation, where you publish your navigational menus. You get a lot more positions, but also much more flexibility. So if you have a module that needs its own position as in your question, let's have it that.

create dynamic template for joomla 1.5

there are tutorials on the web about gow to create index.html, css file and template.xml that contain placeholders. ok, i got it, it's simple. but i need a template that has some different views. for example:
-all pages have a topmenu, header, left sidebar, mainarea and a footer but:
-first page has no header .topmenu after which sidebar, mainarea and footer comes.
-second page has sidebar moved from left to right
-third page has four blocks (blocks for special offers) instead of mainarea.
as far as i can see, i need to create three standalone templates with unique set of placeholders for each template. because i can't see the way to change laarge mainarea placeholder with four placeholders for offers blocks on some pages. dynamically.
is there if-statements in joomla templates to simply determine a document id to view four placeholders instead of mainarea. or to not show header on the main page (f.e. doc. id="mainpage")
but i want it to be selectable like:
-this page has first case of that template (index_1.php)
-and that page has a second case of the same template (index_2.php)
like a selectbox.
is that possible?
I will make this an answer as opposed to a comment since I believe it will do what you are looking for.
Once your articles are setup and your links to them are established (the site has the info on it you're looking for), you can create the modules containing the data that you want shown from time to time.
Go to the module manager - on the right you should see 'module assignment' or something along the lines of 'display this module on the following pages'; you can then pick which pages you want the module to show on. You can specify all pages, none, specific pages, however you want.
This will enable you to show them only where needed however you like.
You can ALSO do this programatically inside the module (if you do custom HTML and use an extension like Sourcerer to add PHP to the module) with PHP should you want a little more flexibility, but just choosing the pages to show on should work for what you're doing.

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.

Magento - adding a new field to the product options in admin

I'd like to add a new tab to the 'catalog->manage products->product information' page in the admin. Underneath the 'images' tab, I'd like to add a new tab for video, with a simple text input for adding a video url, which I can then grab for the frontend.
Anyone any ideas where the files are that I need to edit? I've been looking for the last couple hours with no joy. I found the list of current options in Mage_Catalog_Model_Resource_Eav_Mysql4_Setup but can't figure out how to add to them...
Seems it gets some from Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs. If I copy one of the tab sections here and change the title to Video, I can get it to display in the tabs on the left. But how do I then add the options for it?
What you are trying to do, from the sounds of it, is to create a custom field and add it to your catalog data. The good news is that you don't need to muck around in the PHP for that.
Head to Catalog -> Attributes -> Manage Attributes and create a new attribute for yourself called "Video URL" (or something to that effect). This will probably be a text field, and you may want to hide it from comparison on the frontend of the site (select "No" for all those boxes at the bottom of the form).
Once you've created an attribute, you will need to add it to an attribute set. If all your products are of one "type", and if you didn't create any other attribute sets, this should be only one step. Head to Catalog -> Attributes -> Manage Attribute Sets and create a "New Group" called "Video" and drag your new video url attribute into it. Save the attribute set and you should now have your new tab.
The only complication from what I read in your post could be positioning it underneath the images tab. Magento adds several tabs statically (the long way, in the PHP) and doesn't generally obey ordering of the tab groups. Consider the time tradeoff.
Hope that helps. Thanks,
Joe
Per your other comments, for the URLs a simple attribute would work but files would tend to be more difficult. To add a custom tab, as you said, you can edit (or in the case of a plugin, override) Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs::_prepareLayout and add your tab. You'll need to add a block or template to display your tab contents.
After that, you'll need to store the data somewhere. Looking in Adminhtml/controllers/ProductController, you should be able to hook into the catalog_product_prepare_save event to get data from $event->getRequest() and push it onto the product or save another entity as necessary.
I'm not sure how well file saving semantics would work on a product, so you may want to do your own data storage in the extension and then provide something like a getVideoForProduct method to retrieve it.
Then the only thing left to do is modify the catalog/product/view.phtml template file to include your thumbs and create a controller in your extension to provide a modal w/ the video (or do it in JS).
I know that's a bit of a general answer, but it's the rough path you would need to take for tabs. Let me know if any specific part of that is unclear.
Thanks,
Joe

Resources