Create child page template based off book parent page in Drupal 7 - drupal

I'm still learning Drupal, but I'm completely stuck at this point. I need to create a template for the child pages based off the navigation link clicked.
This grid is a Bootstrap thumbnail grid serving as a navigation menu. I want to know how to create a template page based off the parent navigation menu item. Each page will have the same format based off this menu.

It's unclear what you're trying to achieve, but as far as I can tell, you might need to start by trying to identify what those pages are and what parts they consist of (views, blocks/regions, nodes etc.) and then theme accordingly. Take a look at a diagram here https://www.drupal.org/docs/7/theming/overview-of-theme-files to get a better idea of how this all works together.
Once you know what you're dealing with, look for customization options. It can be anything from theme settings to views configuration, working with css, blocks, custom page/node templates (see here https://www.drupal.org/docs/7/theming/template-theme-hook-suggestions) etc.
If you need more info - please provide more detail, like links/screenshots of the pages that you need new templates for as well as explanation of how those 'templates' will need to look like

So basically once you choose The book menu item "Topics", you arrive to the topics page with the navigation menu (shown in the screen shot above).
When you choose one of the images in the thumbnail gallery (first screen shot), you are supposed to arrive to the child page for that menu item chosen (sub book page). All the sub book pages (are supposed to have the same format displayed in this basic sketch screen shot displayed below).
So for that, I am required to make a template for these sub book pages.
I just realized too that these sub pages would probably share the same parent of topic, so most likely, I have to create a template based off the action that "topics" = parent page ?
Screen shot of sub child page for topic chosen/ sub book page
thank you for your patience guys!

Okay, after working with my new partner, we discussed trying to create a view that will have headers:
<h1>**Topic Overview**</h1>
[user content input under title] <br><br>
<h1>**News and Initiatives**</h1>
[user content input under title] <br><br>
<h1>**Resources**</h1>
[displayed depending on tag chosen to display]
We just cant figure out how do we keep these headers constant, but allow the content to change, or be changed for every sub nav item (child page from nav menu above).

Related

Drupal add link to another page in header of a block

In Drupal 7 I created a views page, and I want users to have the option to view the results either as a list, or with thumbnails (like on a lot of websites). The only way I can think of doing that is creating one page with the results as a list, and having a link to another page with the results that have thumbnails.
But my question is, how do I add just a random link to the top of my block page that will direct users to the 'thumbnail' page?
I tried to use 'unfiltered text' in the header and put the html for a link in there, and when I went to the page it looked like a link, but I couldn't click it. Any suggestions?
For every view you can create set of templates to style it. When you edit you view open "Advanced options" and then at bottom click on "Theming options" (or suggestions...can't remember real text).
That way you'll get a very useful popup which displays all templates used by view...in specific theme. So if you want to change some template just click on it's original name, pick up it's original code (copy) and create a file. Save it at your theme templates directory, pick some of suggested names, add your link or what ever html you need and clear the cache.
Templating is a bit broad subject to discuss in details for you questions's answer - find some tutorial on net, but general idea is to use custom view template and store your html there.
BTW, I hope you have only one view and different displays for you different pages.

Blog posts not highlighting the active menu item

Ok, I know that there are several other questions on SO regarding this topic. By now, I have probably read all of them. I have been researching this for a little over two hours now and I am coming to the end of the road (about to give up!)... So, here I am on SO finally asking the question to involve other sharp minds.
I am helping build this Wordpress site: greatman.us. And, the Posts page is located on a page called "Blog." The "active" menu item is highlighting properly on PAGES, but when you go to a POST, the "Blog" menu item is not longer highlighted (i.e. NOTHING is highlighted in the header menu).
There is no way in Wordpress - as far as I'm aware - to create a "parent" for a blog post. This option is only available for Pages. I need to be able to have the "Blog" menu item stay highlighted when I am viewing a BLOG POST.
For a general example:
mywebsite.com/blog/ <--- menu item "Blog" is highlighted
mywebsite.com/blog/post223 <--- menu item "Blog" is no longer highlighted
I am proficient with CSS and HTML, but not with PHP. So, if this is a PHP fix, please dumb your answer down as much as possible.
I have read tons of other articles about this online and it seems to be a common issue, with most people not knowing how to code with PHP.
I am using a custom theme, called Divi. And it is missing some of the CSS elements that other forums and sites I have read said that the style.css should have. This is another reason I am coming to a dead end. Please help!
By the way, one WORKAROUND I discovered is to add POSTS as sub-menu items to the "Blog" page that you made in the Wordpress Menus area (in the admin back-end). Then, use "display:none" is CSS to remove the submenu from being displayed to the public. This causes two main problems, though: 1) You can never have any other sub-menu items, because they won't be displayed. 2) You have to manually add every single blog post to the menu as a sub-menu item. This will eventually make your menu super long assuming you are a regular blogger. It is also a hassle.
Within your CSS, you will also need to add .current-page-ancestor with the same attribtues as your current menu item.
Something similar to below:
.current_page_item, .current-page-ancestor {
// Some attributes
}
This is guessing that you have use wp_nav_menu() though. If not then I'll need to see what code you have used to generate the menus.

posts as children of wp_list_pages item

i have a vertical menu that looks like this
HOME
NEWS
ANOTHER PAGE
- SUB PAGE
- SUB PAGE
it is retrieved via wp_list_pages. NEWS is set as my posts page in the WP backend.
what i want to achieve is getting the titles of the 3 latest posts to show up as a submenu of NEWS like so:
HOME
NEWS
- POST 3
- POST 2
- POST 1
ANOTHER PAGE
- SUB PAGE
- SUB PAGE
is there some sort of add_filter/function or even plugin to achieve this?
The problem looks as if you're trying to use a Page Object as a sort of "shell" for corresponding posts. This is probably one of the first traps a Wordpress Developer will find themselves in when developing their own themes, or working with existing code.
In short, you shouldn't use wp_list_pages if you're trying to also list Post Objects. It gets messy, and you're essentially circumventing existing methods that Wordpress provides to do exactly what you need.
What you'll want to do is look into is the built-in Navigation Menus to build out a more flexible menu. If you're using a downloaded theme, then it will almost certainly be supported. Otherwise, you'll need to look into Registering a Navigation Menu to make your theme "menu-aware".
What this will enable you to do is build a flexible menu that supports not only Pages, but also Categories and individual Posts in an intuitive UI. I would suggest deleting that Page Object called "News" altogether, and instead place the News Category in your menu alongside all of your Page Objects in whatever order you like.
As for querying the most recent three posts in your Navigation Menu as sub-menus, this will be a little more complicated to do with pure code.
What I would suggest is to look into this option first. Build out a working - albeit static - prototype to get a feel for the Menu Interface. If you're writing your own theme, replace your wp_list_pages call altogether with wp_nav_menu.
Once you get that working, open a new question to see how to write your own Nav Menu Walker to make everything display exactly how you want.
By taking this approach, you'll ensure that your theme will ALWAYS behave how you want automatically, rather than having to go in every so often to patch things up.
Let me know if this helps.

Joomla not showing articles

For reference, This is what the site looks like,
here is the index.php
and
here is the current template.css being used.
My problems are as follow:
Using the first menu, [Quem Somos] as example, I've created a category and under it I've put some articles. Using the default mod_mainmenu, how would I make it display a dropdown menu?
I can't do it even if the primary menu items are created as lists of categories or, when the submenus are linked directly to articles and then these submenus are linked to a primary menu, the module just shows that one level pill menu shown. Do i need an extra module or something? am meddling with swmenufree but am guessing something basic as a dropdown menu fed by a category/section is something that should be built in.
In my quest for a 3 column template I've most definitively destroyed something and now whenever i click any link (all links have articles to back them up) the site just shows the same main page. clicking and typing (c&p actually) the entire URL in the address bar gets me nowhere also. The URL it shows is correct but what i keep seeing is the landing page
Looks like you're missing the following:
<jdoc:include type="component" />
Place this where you want your content to appear (your middle column)

WordPress 3 - Problem with menu highlighting

I'm building a site that has a two level menu created with the admin Menu tool. The menu contains links to both Pages and Category lists. It doesn't link directly to Posts. The problem is that when you drill down into a Category list and click to view a single post in that Category, the menu highlighting gets it wrong.
I've tested on a new install of WP3, set up a simple test site with a few pages and posts in 3 categories. All I've changed in the theme is the style.css to highlight the whole path.
http://danwashere.com/wp_dev/
Here's a direct link to view a categorised post here:
http://danwashere.com/wp_dev/2011/07/28/blue-rocks/
Everything is a page, except with the section "Advice Categories" - all those sub items are category lists containing categorised posts - each post is only categorised with a single category. The menu structure is defined entirely in the Menu settings.
On that Blue Rocks page, the menu should be highlighted like this: Advice Categories -> Rocks, but it's highlighting the Sample Page item. And if you rollover the "Advice Categories" menu, you'll see that it is correctly highlighting the "Rocks" menu item.
It seems to me that WP is applying the 'current-post-parent' class to the wrong top menu item, but maybe I'm missing something?
// Edit, rewrite to make it clearer.
It seems as though were both having very similar issues. - Trouble highlighting correct menu parent with wp_nav_menu classes while viewing “single posts”
Im not using categories as links in my menu but I use them to filter content to each page via query_posts...if you examine the output from Wordpress you'll notice its actually placing the current page class onto the incorrect li tag when viewing a single post - Is this happening to you as well?

Resources