Cannot access my custom Joomla module - joomla

I'm using Joomla 2.5 and I created a custom module from scratch.
Basically, the purpose of this module is to be embedded in an article and to perform ajax request and display some updated data.
I do not manage to have Ajax working (but this is another topic).
The thing is, when I call the url: index.php?option=com_mymodule I have a 404 error. The module is public and is embedded in a public article.
Any idea?

You cannot access a module by an url, however you can access a component by url. More information is found here.

index.php?option=com_mymodule
Did you make a component or a module? This is a bit confusing.
You say you want the module embedded in an article. I that case you would normally use something like {loadposition positionname} where positionname is the name of the position the module is assigned to.

Related

Override JE Quick Contact module in Joomla 3x

My client is using the module Je Quick Contact in their site, in Joomla 3.7.3
As default, the sender email is user's one, but in that way sometimes email goes in spams.
We would like to change it to have a generic send contact#domain.fr, seems we can't handle it in Back-office.
So I tried to override the module to change the sender email.
The module was in modules/mod_je_quickcontact and there there is files mod_je_quickcontact.php, index.html, mod_je_quickcontact.xml and folder CSS, JavaScript, PHP, images
In my template I created a folder mod_je_quickcontact and I put there all thoses elements, and I changed the file mod_je_quickcontact.php
But it's not working, it's still default data which are displayed.
I looked at Internet to see how to override, but for all example I found, in default module there is tmpl/default.php file to override. I don't have such folder and file.
Maybe I missed something or I did it wrong... I don't know what to do know, so, if someone has an idea, it would be great!
I think in Joomla there is only a way to override a template or layout of modules. The module you used is not best practice, because there are not using a default template (tmpl/default.php) to display the output of the module.
Like in Joomla docs mentioned:
The directory structure you need is: TEMPLATE_NAME/html/EXTENSION_NAME/VIEW_NAME/FILE_NAME.php
(Source: Joomla override documentation)
What I would do: Copy the module, change it in the way you need it. That´s it.
There have to be a difference between paid and free modules :-P

Why isn't loadposition working to load a module within a custom HTML module in Joomla 3.2?

I am developing a website with Joomla 3.2. I want to put a search box inside a custom HTML module. I have the module loading plugin enabled, a module position defined for the search box ('searchbox'), created the module instance, assigned it to the correct position, enabled it, and made sure it was assigned to all pages.
Inside my custom HTML module I inserted the following:
{loadposition searchbox}
As you can see here - http://ojospa.webez.net/ - it isn't working (look in the upper right hand corner).
Why isn't it working? I've looked over everything to make sure there were no typos and everything looks fine.
Any help would be appreciated.
Thanks!
Cynthia
You need to enable the "Prepare Content" parameter in the options of the module. Then it should work.

PyroCMS Custom Module Layout

I created a custom module called Drawings. I wanted to give it its own theme layout on the frontend, so I followed the advice I found HERE - I put a layout file titled Drawings.html in my theme.
This had the correct effect on the frontend, but caused other problems and questions that I've been struggling to sort out:
The backend admin section for my module now uses the Drawings.html layout, which breaks its functionality completely. How can I set a specific layout for my module front end, but keep the standard admin backend layout (same backend implementation as in the sample module tutorial)?
I read the following in the Template Library: "When using Public_Controller and Admin_Controller, the layout is already set." Perhaps the solution involves using the set_layout function in these controllers somehow? All my attempts failed so far though.
I feel I am doing something incorrectly because now my module is not modular. For example, after creating the Drawings.html layout file in the theme, a statement like {{ theme:css file="drawings.css"}} in that layout file searches for those resources in my theme. So I have to put those JS and CSS resources in my theme, instead of in my module's CSS and JS folders. How do I keep and access my resources in the module's JS and CSS folders?
I don't know how this is supposed to work.
When you are using front end controller use a layout there using philsturgeon template library like this
function index(){
$this->template->set_layout('drawing')
->build('yourview');
}
This way you can load a custom layout for your application.

joomla rename component url using htaccess

I'm building an eshop using Joomla 2.5 and a commercial component for a guy who wants to have multiple vendros and I'm stuck on how to change the component's url.
What I want to change is the url that is displayed when the users passes from a link with his mouse.
For instance, the component has a SEF function which rewrites urls and makes them like that:
http://www.site.com/componentname/products/productname-productid-productcategoryid-vendorid.html
http://www.site.com/componentname/catalog/categoryname-categoryid-numberofpage.html
and what I want is to make it:
http://www.site.com/shop/products/productname-productid-productcategoryid-vendorid.html
http://www.site.com/shop/catalog/categoryname-categoryid-numberofpage.html
So when a user passes over a link it will show him the new url. Is this possible with .htaccess and rewrite rules or this can only be done through the component only? I'm asking this as the component is encoded with ioncube so I can't do it myself.
Thanks in advance!
While you can use .htaccess to rewrite any URL it won't work with Joomla! as the SEF URL is created by JRoute which uses a combination of the core route function and the route.php for the component.
The URL segments are used to find the right component to handle the request, so to change the way the URL is built you would have to modify the route.php of the component (and obviously other parts as well).
For more information on how SEF support works, read this on docs.joomla.org

Joomla Login module not working in artcle

I am loading the Joomla login module in an article using {loadposition xxx}.
when cache is on it doesn't works and give the error of Invalid Token.
What I figured out is that it is taking value of hidden field of the Joomla token from the cache which is usually generated randomly differently every time login module is loaded.
Can anybody have some idea to make it works?
First you cannot remove the hidden field of the token because this way the form will never work ... It's a required parameter so you have to restore it back and follow these steps
Go to the Module manager
One the module
The first item on the parameters is called "Caching" set it to never.
EDIT
You better use the plugin Modules Anywhere by Nonumber.nl
It fix 99$ of the issues that occur because of {loadposition} in regards to module title, content, caching ... etc

Resources