Creating Drupal custom menu and retrieve item in a template page - drupal

I would like to create a menu in Drupal backend, a custom menu which have xxx items.
How can I use the Drupal API to retrieve it in a template.tpl.php, and display items?

have a look at this page at drupal.org: Menu theming
-J

I created a custom menu using this method as well as some related ones. You will need to generate a custom module for your menu. You won't retrieve it in template.tpl.php but rather as a block (by creating a custom module). I would suggest you start there first.

I would do the following:
Create a custom menu
Create a new regions in your template .info file
Go to your theme and print the new region where the menu should seen
Go to the blogs and activate the new menu in the new region area
Maybe this should work for you.

Related

How to create such buttons with Wordpress?

I'm very new to WordPress (tbh, it's my first time working with it). And I need to make a website as my school project using CMS. Creating pages with templates is alright, but I have a lot of troubles with buttons. I found this website, and I can see it using WordPress. I need such buttons as on this page https://movie-chooser.co.ua/random-movie-2/ (they appear when you hover over the image). Is this a default option for buttons in WordPress? If not, is there a plugin for this or what is the way to add them on my images?
First Install Elementor plugin https://wordpress.org/plugins/elementor/
and go to page when you add button and open page with elementor
and do drag and drop any element like button, space, text editor etc.
You have several ways to achieve that:
Overwritting Wordpress CSS
Using a plugin
Create your own shortcode
1 - Overwriting Wordpress CSS
If you manage to display all the elements using wordpress template, and your only issue is to display buttons over the images, then it should only be a matter of CSS
2 - Using a plugin
The idea here is to find a plugin that help you to create/display the informations you need (maybe you'll need to add functionnality to basic post though custom fields or using a custom post type).
Once you find the right plugin, again if the plugin dosen't directly offert some settings on the design then you'll have to overwrite the plugin's CSS rules to display the elements as you want.
3 - Create your own shortcode
If you're new to Wordpress I wouldn't recommend this method as it is kind of advanced, unless you're comfortable with PHP/HTML/CSS (optionaly JS).
This is the more flexible solution as you can basically control anything, but it will require you to understand some core concepts of Wordpress like WP Query and how custom queries works.
The idea here is to create a shortcode.
THis shortcode refere to a custom made PHP function, in which you can create a custom request to fetch the informations you need to display from Wordpress database, and display it in an HTML structure that you decide.
THen angain, you'll just have to customize it though CSS.
Note : no need to create a whole plugin if you decide to create a shortcode, you can use the template functions.php file for that.

Custom Page Templates in WordPress to show Content in specific layout

I want to create a custom page template in WordPress which shows Image Slideshow and then a video below it and finally some text - till now what I am able to do is play with sidebar, footer, header.
I can either remove them or keep them in my custom page templates but what I want to do is play with the page contents.
The Admin user should be able to see these sections in the Page Editor (WYSIWYG) when they choose the Template from the drop-down, so that they can accordingly add the correct content in correct place holders
Something like the attached screen-shot is showing
Is this possible in WordPress
Yes! It's possible to implement this! you can use https://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431 or https://wordpress.org/plugins/siteorigin-panels/ plugin.
The first plugin allows you to create different page layout and save it. It also allows admin to choose page layout that admin has saved previously.
The second page builder plugin allows you to create template same way and allows admin to clone one page layout to another one.
Hope this will help you!

Attach image to custom menu in wordpress

i'm trying to attach an image to a wordpress custom menu
for that i made a admin walker and added a link that uses the new wp.media (3.5) uploader with the featuredImage file frame.
everything is ok until i slidedown 2 menu options... then i attach a picture and the picture is set to both menu items like this
i use stopPropagations and still execute for every item displayed
this is the js http://pastebin.com/qBqt3tEN
any ideas?
Found the solution using another plugin idea
i created a gist with it
https://gist.github.com/hugosolar/6077109

Drupal 7 admin new menu

Is it possible to implement a new admin menu in Drupal 7?
Currently I am using Seven theme.
What I want to do is adding another tab on the Content menu with just: Comment, Comment to content, Comment, Submission.
I added a new menu on the admin menu structure, but the menu is not showing anywhere.
I made page--admin--content--submission.tpl.php to start making the interface, but I can't make it according to the current selected admin theme.
Please point me somewhere since I already googled with no luck.
Update screenshot :
Did you try clearing your cache? You can do that via the Performance page, at yoursite.com/admin/config/development/performance.

Drupal: how to change taxonomy header on page with items?

I have a menu item like
http://localhost/drupal/?q=category/articles/php
It's supposed to output all stories about PHP,
But in resulting page header (with term name (PHP) ) doesn't look very well.
How can I remove header or change its CSS style?
Your best bet for customizing the page is to use the Views Module and activate the taxonomy_term view. Then, you can add to the header field or even create a new template just for that view.
The Drupal Handbook has a lot of great resources for theming and building views:
http://drupal.org/node/352970
Take a look at Drupal's theming guide:
http://drupal.org/theme-guide
You'll need to understand theming to edit css or html.

Resources