Charlie W Posted September 25 Share Posted September 25 I have a page that lists products for a lumber manufacturer; I'll call the manufacturer "Acme" for this example. Acme's products include both decking lumber and siding lumber. On the menu, when the user selects "siding", I need to load the page that lists the decking lumber and then the siding lumber and jump to the first siding product. Pretty straightforward...I have an <a id="siding">...</a> tag on the target page. The menu link target is "acme#siding", but when the URL gets rendered in Processwire, it changes it to "acme/#siding" (with the slash). I'm not sure how to get the result I am looking for. Any help is appreciated. Link to comment Share on other sites More sharing options...
ngrmm Posted September 25 Share Posted September 25 @Charlie W your question ist not directly related to processwire. You would get or find an answer more quickly on stackoverflow. Or just ask chatgpt, claude, … acme/#sliding is correct. Just make sure that you do not have multiple elements with the same id. Then you link <a href='#siding>siding</a> should get you to your target <div id='siding'></div> Link to comment Share on other sites More sharing options...
Charlie W Posted September 25 Author Share Posted September 25 No. The proper way to link to a bookmark on ANOTHER page is "acme#siding", not "acme/#siding". The slash renders from Processwire, but my link is correct. Processwire is changing my link <a href="acme#siding">Siding Products</a> to acme/#siding when you view the URL at the top of the browser. Link to comment Share on other sites More sharing options...
Jan Romero Posted September 25 Share Posted September 25 (edited) I’m assuming you do something like this: <a href="<?=$manufacturer->url()?>#siding">Get Wood</a> Go to the template settings of the $manufacturer page’s template and in the URLs tab, set the slash option to “No”: This will make the url() method generate links without the trailing slash and it will stop redirecting to the slashed version. That said, I’m pretty sure the links should work either way. Edited September 25 by Jan Romero 2 Link to comment Share on other sites More sharing options...
Charlie W Posted September 26 Author Share Posted September 26 Jan: Thank you. That accomplished what was needed! SOLVED Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now