1

I know this is a broad question but I really need to ask it. I started using Joomla a long time ago, and I have build a pretty extensive system that is highly used but I never liked the way I did it. Now I am trying to be more professional and I think it is really time to change, but I can't seem to figure out the proper workflow.

So the basics I need is that i have to create an entire website with dynamic databasing content on each page. I need each page to have it's own nice-looking URL. like www.mysite.com/cool-page, www.mysite.com/category/other-page etc.

I also need to have PHP scripts to answer AJAX calls.

The way I have been doing it so far is that I create an article for each page, and link each article to a menu item. This was the only way I could find to linking each article to a nicely-formed URL with slug.

Since I need PHP in the pages I installed directPHP and inserted my PHP directly into articles.

For AJAX scripts to return the AJAX requests I just made another folder in the web folder and put stand-alone PHP files. I could not put these scripts in articles because often the extra content that was loaded would cause problems for me. I needed just a clean RESTish script there to answer requests. I had to put in my own security code to make sure only users with correct permissions get access etc.

Since this all seems so hacky to me, recently I have been doing new projects in django which has many straight-forward docs about how to setup this scheme the right way, linking URLs to back-end scripts (of course this uses python).

I'm just wondering how I am to do this "the right way" in joomla? How do I get complete control over the URLs and content without having to like menu-items to articles this way?

2
  • 2
    I think your question might be something like - "how to treat Joomla CMS like a framework" - to which the answer is point the home menu item at your custom component and build the whole thing in the component with your own router. But lots of things in your post point to a variety of other questions which broadly are: "in what ways can one architect Joomla as an application leaning heavily on a ajax/rest approach?" In any case, I would revise your question or perhaps ask more than 1. Aug 26, 2017 at 0:17
  • @jamesgarrett Thanks for the feedback. You're definitely right about both issues. I asked this question as a general "big picture" question but yes I think you're right that it is actually many smaller pieces to put together instead of just one main issue. Aug 28, 2017 at 11:32

1 Answer 1

1

You don't need to create a menu item for each article. All you need to do is to create a menu item pointing to a category blog (let's call it news), and then assign the newly created article to that category. So, if the article has an alias (slug) of 'my-article' and if that article has an ID of 3, then the link will be (if you are using Joomla's SEF): news/3-my-article.html.

The alias (slug) of an article is generated by:

  • Transforming everything in the article title to lowercase.
  • Replacing any non-alphanumeric characters to a hyphen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.