Pagination in front end Module Joomla - php

I've searching trough google for a way of adding pagination into a module, but i could only find information about adding it into components like here:
How to add pagination for component front end (Joomla 2.5)
Is it posible to implement this same principles to make a pagination for a module?, or a different approach is needed?

I think this is not the correct way of doing to try to implement pagination in a joomla module. Normally, only component are made to be able to use standard Joomla pagination, because it uses itself models and view controller...
The example we see on the link you propose is using pagination from the view controller (view.html.php), witch extend JViewLegacy (witch is an alias for JView). Pagination is natively supported by it.
I imagine you need to show many items pages on a module, but maybe reload the page for it is not the best option. You can perhaps try to load more items, and to use a JS script to do pagination (even a slider can do it nicely), or simply to add a link to the whole section of the associated component.

Related

Joomla, create custom php page that list some results

I try to create a custom results page for my custom entities (database).
So, i have in home page a search box, the form have to redirect to this "custom" page.
What is the preferable way to accomplish this?
I tried to add new php page to my template, but how can i achieve SEF url in this way?
Not specially the best way, but a simple one :
For displaying results, you could create a Menu-item containing an Article.
The search box form would be submitted to this Menu-item.
In order to process these data here, you could use an plugin like Sourcerer allowing to write PHP in Articles, Modules, etc.
This solution using Menu-items, it would be SEF compliant,

Symfony website with dynamic content (loaded from the database) in the navigation

The website I'm working on has a navigation menu item called categories which is a drop-down containing some entries from the db (the users can adjust the categories from the admin panel.) The navigation is located in a base.html.twig file which is extended by all other twig files.
Question: What's the best way to get those entries? The only way that comes to my mind is use a call to {{ render(controller(...)) }} which would create a new request, what's a little overkill in my opinion and will slow the page in general down. Is there a better way to do it? Maybe an event which is called on every request and is able to transfer data to the view file?
You have two good options to achieve this :
Use render() in your twig template to call a specific method from a controller (as you said in your message)
Create a twig extension to render your menu, it's very simple : http://symfony.com/doc/current/cookbook/templating/twig_extension.html
In my opinion you should use the first option (a controller), since you only need to render your menu 1 time. Twig extension are better designed to be reused in several templates.
About your performance concern, don't worry, all you need is to cache your menu since it won't change often, and invalid the cache when the menu is updated in your backoffice.
Regards

basic joomla extension development confusion

I want to develop a joomla 2.5 porfolio extension.
So I need something in the backend to enter a couple of details.
On my frontpage I want to have listed the six latest projects and there will be a page in the frontend where all projects are listed.
I'm new to this whole joomla thing. At the moment I'm reading through the joomla docs and tutorials.
I'm a little bit confused because I'm not really sure which type of extension do I need.
Can all this be done with a single component or a module or do I have to mix both?
Because what I've understood so far a component can just be displayed as a independent page.
And a module has to be included in a page. Like {lastSixProjects}?
Can some please enlighten me a little bit?
If you want to create a page with portofolio only, you may create a component without a module...
If you want to put your portofolio in eg.: articles pages, search page, in a sidebar etc (like a image slideshow plugin) you must create a module (with a component assigned to it)
Please read this: http://docs.joomla.org/Extension_types_%28general_definitions%29 .
I undestrand that you want to put your portofolio in your front page... in this chase you MUST create a module.
Little explanation:
A module is an extension (similary to boxes, or widgets) that are arranged arround a component (in this chase com_content - on your FrontPage). Eg: Ads Module, Search Box Module etc.
A component is a super complex extension (similary to mini applications). It has an administration part and front-end part. All Joomla! pages loads a component. Eg: Content component, Search component etc.
I hope this will help you.
You want a component. Please read this: http://docs.joomla.org/Extension_types_%28general_definitions%29
Agree on 2 previous answers, you need a component with at least one table to store your projects. Then you need to link to a menu a view of the elements on a table. You should be able to make it work in 15 minutes with this component creator for Joomla http://www.component-creator.com/

Joomla - configuring basic parameteres for my component in menu manager

Im still relatively new to Joomla component development.
I have a component that manages rsvps to events.
In the administration side you create various events and specify the details of when where and what time the event starts etc. Each event has an eventid.
In the frontend I want to be able to show a specific events details when a menuitem is clicked.
In Joomla administration, my thinking is as follows:
1) Go to Menus->Top Menu
2) Click on [New] to create a new Top Menu Item
3) My component is listed there as MyRSVPComponent
But when I click on it, nothing happens??
All the other default components like search have submenus that you can click on that takes you to a Menu Item page and you are able to configure the Basic Parameters on the right hand side.
I want my component to behave like that as well and I want to be able to pick the event from a list that I want displayed for that menu item. How would I go about doing this?
Please do note that I have not followed the Joomla 1.5 MVC structure for my component.
Can I still make this work, or am I forced to create the project with the MVC structure.
I have my reasons for not wanting to go with MVC for this particular project so please do not just suggest that I go MVC unless that is the ONLY way that I going to achieve what I need to do.
The options you see in the menus are controlled directly by the views in your component. You will need a view for each menu item type you would like to have. You don't have to go MVC but it would certainly make life easier.
I just came across this question with the view to integrate a Symfony project into a Joomal component. Naturally I don't want to use the Joomla MVC for this as well.
I have done some debugging on how to create your menu links:
You need to have the link field set for your component, matching your component folder
You need to have the views folder, matching the "option" field value of your component database entry
As soon as you have this, the menu manager is going to show your views as options
To have specific view sub options, you need to create /com_yourcomponent/views/yourview/layout.xml, copy these from com_content. In there you can also define your menu options.

Using Symfony, sfDoctrineGuardPlugin plugin, How can i customise sf_content? Using partials?

I am using symfony 1.4.8 with sfDoctrineGuardPlugin for my backend.
My question is how can i customise sfDoctrineGuardPlugin's default content? For example, how can i do something on the page between filter and table (on the left hand site)? Or, how can i customize table (http://goo.gl/ZmRey)?
I cannot find any solution for using partials on backend. Is there any way to use partials/components/slots on backend?
I hope you understand my question and tell me a way.
Thanks for your answer(s),
Erman
Partials, components and slots are no different on the back-end to the front-end - your "backend" is just another Symfony application. From the screenshot you gave, it looks like you're looking to customise the admin generator theme.
The quickest way to get started with this is to look in your cache/appname/ folder and see the automatically-generated modules here, with all the template files, partial files and so on. You can then create an empty module in your application, and override select parts of the theme with whatever you want to change. See this part of the Symfony docs for a full list of partials etc, and how to go about overriding them in more detail.
In the specific case of sfDoctrineGuardPlugin-module pages, these can be overrided in the same way as normal modules - simply create eg an sfGuardAuth module and override the selected parts of the module you want to.
If you want to go further and create your own admin generator theme, this is a bit more advanced. Here I will shamelessly promote a blog post I wrote last year ;-) John Cleveley's presentation also provides some great tips.

Categories