Joomla 3.x, include menu items in search results - php

I've built several sites using Joomla and think it's a pretty decent framework to work with. However, one thing that really bugs me is that menu items don't show in the search results (com_search).
All I get is articles, contacts, weblinks, categories and news feeds which are all completely irrelevant to my needs. Right now, all I get in the results are links to articles (for example) which leads to that article but leaves out all the good stuff you get when accessing it through a menu item such as modules.
So what I really want to know is if it's possible to force the search component to include menu items and leave out stuff that is unnecessary?
EDIT
You know what, having reviewed my code and all that I've realised that my original question was a bit misleading. Now, what I REALLY want to accomplish is to restrict Joomlas com_search to ONLY search published menu items and nothing else. Is this possible?

Related

Wordpress one pager: how to structure / posts or pages?

Heyho,
I'm new to wordpress and currently building a website for a client. It's a one-pager and I'm wondering how to build the backend.
Let's say it's a cat-business. And the structure is as following:
Haircutting
Baby Cat Haircutting
Long Hair Haircutting
Special Hair Cutting
Photoshooting
Single Studio Photos
Group Studio Photos
Owner + Cat Studio Photos
Outside Photos
Training
Faster Running
Higher Jumping
Better Mouse-Hunting
News
Contact
The categories 1—5 should form the Menu.
Every entry is (until now) a post and has several custom fields (e.g. Price, Duration, Location…) and that works fine. The Client needs to be able to edit / add / remove the single entries (e.g. "Special Hair Cutting").
How should I build it know?
First Idea
Making Pages for each category, showing the single posts assigned to the
"wordpress category"
Make the Home-Page show all the pages
Second Idea
Building everything in Posts
Building also the categories 1—5 in Posts and figure out how to apply
special CSS (workaround with Custom Fields?)
What is the smarter way to go?
Anyways I'd need further help afterwards, linking the best tutorials, as hours and hours of searching didn't help me any further.
Thanks.
Appologies for my bad English
You can build a simple one-pager by looping through the pages with depth 1 and then through each of their subpages. You can use the get_pages function for this.
Make sure to redirect the individual pages to an anchor on your one-pager/home (with a redirect plugin). This will prevent people from finding your individual pages through the search engine.
How get_pages works: http://codex.wordpress.org/Function_Reference/get_pages
How to loop through your (sub)pages: http://wordpress.stackexchange.com/questions/93844/child-pages-loop‌​

Navigating through custom post types in WordPress

I want to redesign my website using WordPress (as CMS) and Bootstrap (as front-end).
Now, I've been pretty successful at doing so, but I have one specific problem.
I have a tutorial website and I want the navigation structure to look like this :
If the user is on my 'website-name/tutorials' then display to him all of the tutorial series titles in an unordered list (so for example C++, XHTML and CSS - but not individual tutorials in each series)...
If the user clicks on some specific serie, then display an ordered list of the elements (so, if he clicks C++, then URL will be 'website-name/tutorials/cplusplus' and he will be able to see all of the tutorial in an ordered list).
If the clicks on one specific tutorial, then the URL goes (for example) 'website-name/tutorials/cplusplus/installing-the-program' and user gets all the content related to the tutorial.
Now, I have been experimenting with this and concluded that the best solution is to create custom post type named "Tutorial" and then make every single tutorial that post type.
However, since on 'website-name/tutorials/cplusplus' I want to display the list of tutorials in "C++" tutorial series and on 'website-name/tutorials' I want to display only the tutorial names, I don't know how to do that.
I tried to do that using Hiearchical posts (so, for example, I made a parent post named "C++" and it's children were all of the tutorials in the C++ serie).
However, I have a problem with that, because my C++ tutorial series has 100 tutorials, but it shows me 101 list elements (I made the website display all the custom post types in an ordered list), with the first one on the list being C++ (the parent post).
So, I'd like to echo the series name only on the 'website-name/tutorials' not on the beginning of the list.
I researched and people seem to use archive in custom post types, rather than parent/child system for this kind of navigation.
I just wanted some of the WP experienced users here to tell me, which is the better solution for my problem? Dealing with these parent/child problems or switching from parent/child posts to archive posts?
If I understand fully perhaps using standard posts and categories will do the trick? Your '/tutorials/' page can display the full list of all posts and when a user clicks on a specific category (e.g. C++) only the relevant posts will display.
You can use the following code to list posts of a specific category:
<?php query_posts( 'cat=20' ); ?>
Changing "20" with the chosen category ID.
Hope this helps!

Jooma 3.1 Templating - Tutorials/Documentation?

I am to develop a Joomla 3.1 Template. The template should consist of a static header and footer, as well as multiple pages, all of which need their own styling. Further, the client would like to be able to add 'events' to a specific listings page. Customers should be able to book said events via a simple form.
Thanks to some really basic guides, I have the header and footer down, as well as some simple template options. However, I am now running into some problems;
How would I approach the content section? Ideally, a page would consist of multiple, editable sections. The client would be able to edit said sections in the backend without having to deal with or accidentally changing the layout or styling of the page itself. Since there are multiple pages, I obviously need different views/containers for each of them. Is this possible and if so, how?
Another problem is the documentation, which I found to be very lacking. Even google only got me so far (basic structure, index.php, templateDetails.xml and so forth). Are there any other resources I may have missed or do I really need to refer to other templates (most of which, obviously, aren't free) and use var_dump all the time?
Writing this, I just realized that I could theoretically build a template for every single page but ... that surely can't be right, right?
If someone could provide a basic outline or at least tell me how you personally would tackle a project like this, it'd be very much appreciated.
All the best
Edit;
I just found some video tutorials but since my bandwidth is limited, I cannot watch them. Please take this into account when writing an answer. Thanks.
I have only one word for you :
GANTRY :D
gantry-framework.org
Joomla revolves around menu items that point to components. For each menu item, you can assign modules to different positions within the template to create a unique page. You only need one template if you really understand how Joomla templating works.
Joomla has very good documentation here - http://docs.joomla.org/
Few things to remember -
Component - this is a type of content or app of sorts. A component will define what content is and how it is displayed. This can be anything from blog articles and categories to an event registration system to a message board or social network. Menu items generally will point to a view in a component.
Modules - these are used to display additional content around the component output. This can be a menu, or a login box, or a weather widget or anything else you can come up with. Modules can be assigned to or excluded from the various menu items on your site.
Plugin - plugins are used to change the final output on a site. They can be used to insert Youtube videos, or forms within content, or even to alter the meta tags on a page.
Understanding how extensions work is an important first step. Once you get how those work, learning how templates and template overrides work will give you most of what you need to know to build a basic Joomla site.

Wordpress - Make category.php list posts from subcategories as well

I'm building a blog where three people will be writing, but they will have a separate section on the site. The structure is built upon categories and looks like this:
User one
Clothes
Fashion
Life
User two
Family
Life
User three
Family
Friends
Life
I've set all three users as writers and used the plugin Restrict Categories in order to lock their categories to the sub-categories the matching each top level category.
Now here comes the question, if I visit http://site.example/category/user-one/ I want to have a listing of all the posts, including the sub-categories since there will be no actual content in the top level category that you are browsing.
I've tried making this using filters bound to pre_get_posts but I still can't get it to work. Does anyone else here have any ideas?
I've also given some though into actually creating a multisite network for the purpose, but I then realized it will be hard to fetch posts from all the networks at once.
Thanks in advance, Jonathan
#Jonathan: Not sure if I am misinterpreting what you are hoping to achieve, but given that each author will already have their own 'author' page which lists all their posts (if your theme includes this or something you could create or customise), there may not really be a need for Users 1-3 to be their own category?
Going back to your question, for listing subcategories, perhaps https://wordpress.stackexchange.com/questions/13485/list-all-subcategories-from-category might be of some help.
As for listing posts, to keep things simple, I reckon you might be able to use e.g. get_posts (http://codex.wordpress.org/Template_Tags/get_posts) and build custom arguments, perhaps in a loop if you prefer to use one instead of slug/id specific category templates.
http://codex.wordpress.org/Category_Templates
If it's any help, Bainternet actually created a plugin that makes life a little easier to define category templates: http://wordpress.org/plugins/custom-category-template/

How Can I Make All Navigation Links in JoomGallery Specific to the Component's Root Category?

In this art website I'm working on for a school project, I am using Joomla 1.5 as the CMS of choice and JoomGallery to display artworks. (I tried to install 1.6 several times, but the "Next" buttons would not work for me for some reason. I installed it manually, but had another issue, so finally reverted to 1.5... and then I realized that the "other" issue was easily fixed. I'll migrate it to 1.6 eventually, but not now.)
On the website, there are three primary categories of art, all of which appear in the menu--Traditional, Digital, and Photography. Each one is linked to a respective category in JoomGallery, each with its own subcategories.
What I want in this case is that each one is locked within its own boundaries, essentially. However, when clicking on the "Last Added" and "Most Viewed" links, images are taken from EVERY SINGLE category I have created and is published, not just the current "root" category I set for the page and its sub-categories. Additionally, I'd like "total number of hits" and "total images" to be restricted to that specific category and its sub-categories.
I searched around and I could not find a way to fix this. I'm sure there's a way, but I'm not too keen on Joomla yet... I've tried looking into it and I can't figure out. I just naturally assumed that this would be pretty obvious--if I set a category in a Menu Page, all the links and everything would be restricted to that single category, but its not the case, and I don't like it.
I know there's got to be a way to do this, but again, I'm really not into Joomla much yet. I managed to build the template from scratch (with a tiny bit of help from tutorials), but I haven't started getting into other Extensions yet. How can I go about accomplishing this task which should have been an option to begin with?
Below is a link to the website. Again, the pages I'm referring to are Traditional, Digital, and Photography. The categories are locked down pretty good (can't view any higher/other categories), but the TOP links don't restrict it by category, and neither do the total number of hits/images.
http://aeternalwings.tsr-online.org
And no, I don't hate JoomGallery... in fact, its the best free Open Source Joomla Gallery I've found, and I doubt I'll find a better one without having to pay an arm and a leg. Its mainly this one thing that's bothering me.
P.S. The artwork on this site is not mine, but I DO have permission to use it. This website is for my fiance, and all artwork was drawn by her, and all photos were taken by her (except for perhaps the self-portrait displayed on the "Blog" page). It was built during a school assignment, and she will later use it once it is complete.
If JoomGallery is not set up to display like you want then it's going to be a pretty major task to change it. In order to get the images to filter the way you want you will need to edit the SQL queries in the model to take the current category in to account.

Categories