$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>menus - Build a one-page navigation within a non-one-page ttheme…|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

menus - Build a one-page navigation within a non-one-page ttheme…

matteradmin10PV0评论

My theme is not a one-page theme. Nevertheless I would like to have on one page of my site a one-page navigation.

For example: In primary menu I have "About us", "Responsibility", "Our offer"… "Responsibility" and "Our Offer" has some sub-navigations points in the drop-down menu. And they are linking to singe pages.

But "About us" should be a one-pager. All the sub-menu points in the drop-down, opening when "About us" is clicked, should not link to different pages, but to the same page but to different sections within this page.

How do I set up this?

Can I build a menu as I would normally do it in the backend. So I drag-and-drop a menu with "About us" and so on. I drag-and-drop some submenu points to "About us" like "History", "Career" and so on. Then I put my content on the "About us" page and add some IDs to my headings like as an anchor. Then I go to the .php-file in which my just build menu is and link not to different pages but to the corresponding IDs.

Thank you

My theme is not a one-page theme. Nevertheless I would like to have on one page of my site a one-page navigation.

For example: In primary menu I have "About us", "Responsibility", "Our offer"… "Responsibility" and "Our Offer" has some sub-navigations points in the drop-down menu. And they are linking to singe pages.

But "About us" should be a one-pager. All the sub-menu points in the drop-down, opening when "About us" is clicked, should not link to different pages, but to the same page but to different sections within this page.

How do I set up this?

Can I build a menu as I would normally do it in the backend. So I drag-and-drop a menu with "About us" and so on. I drag-and-drop some submenu points to "About us" like "History", "Career" and so on. Then I put my content on the "About us" page and add some IDs to my headings like as an anchor. Then I go to the .php-file in which my just build menu is and link not to different pages but to the corresponding IDs.

Thank you

Share Improve this question asked Mar 2, 2019 at 15:39 S.HS.H 1054 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You can do exactly what you suggest. You do not need to create a separate menu or change the php of a page template.

If you add IDs like you suggested as anchors, then your menu items can just specifically target those IDs via the # sign.

To control the link to this degree, you will need to add "Custom links" instead of just selecting the page from the list.

Example Page: (domain/about-us/)

Item on example page : <h2 id="history">History</h2>

Menu item: Custom link pointed to domain/about-us/#history

Post a comment

comment list (0)

  1. No comments so far