Copy link to clipboard
Copied
Nutshell: Does a button in an included header know what page it is on?
Background: I am in the process of completely re-coding some bilingual websites that were generated using Netobjects Fusion. Each site has a homepage and complete web structure in English and a parallel structure in Spanish. So I have a page: aboutus.html and aboutus-es.html & so on. The Spanish page (home-es) is below the English home page (index.html. Every page has 2 language switch buttons in the header: English and Spanish actually as flags. The buttons take you to the respective home page - Not best for the user but it was easier for me :). (Using Google-Spanish or equivalent is not an acceptable solution for us.) The sites need to be completely rebuilt but I am satisfied with the basic structure and plan to retain that for the time being. All of this was easy in Fusion and I am trying to save myself a lot of work and pain by having included headers, footers, menus etc. in the pages that I will code in HTML. While open to other suggestions, my reading so far indicates that using server-side includes with a w3-include-html attribute or PHP would be the most practical solution, assuming my host allows it (am asking).
Questions: I want the language buttons, which are in the included headers, to take the user to the equivalent page in the other language rather than always to the home page. I am hoping that I can use some simple JS to have the button go look on the page it finds itself in for the correct link. That means the buttons will have to "know" what page they are on. Is all of this feasible? Does it depend on how I include the headers? Is there a better way to include the headers with this functionality in mind?
Copy link to clipboard
Copied
Essential cookies are not the same as optional ones.
Regardless of what users say or do, Facebook, Google, Bing et al track data and share it on some level. If you think they don't, you're kidding yourself.
Copy link to clipboard
Copied
To illustrate what I said above, I just recived this email (indicative of similar emails that land in my junk box)
Tracking, another word for stalking.
Copy link to clipboard
Copied
seriously, if people still disable JavaScript, I wonder what they can really see on the web ????
moreover some time ago I struggled like crazy to disable Javascript on Firefox ...
By @B i r n o u
Playing the old card about javascript being disabled. Tell that to those who use React, Angular, Vue and the rest which soley rely on javacript to constuct a whole website........that arguement isnt going anywhere but in the dustbin.
Copy link to clipboard
Copied
Is this site just all manual and no CMS / Headless CMS driven at all?
Copy link to clipboard
Copied
three that everyone has a song and dance... and the OP still hasn't intervened in the debate...
Copy link to clipboard
Copied
three that everyone has a song and dance... and the OP still hasn't intervened in the debate...
By @B i r n o u
Hi everyone - I would love to intervene in some constructive way but, as I mentioned before, I lost my computer and an awaiting a replacement which I am hoping arrives today, via Amazon and a visiting friend from the USA. So I have not been able to try any of the suggestions yet. But the following may help:
Spanish headers only go on Spanish pages: English on English. So I anticipated that the JS in the included header to activate a link on the "host" page should be very simple (maybe 1 line?). Similarly the JS on the "host" page would be just as simple, calling the equivalent page in the other language. I would try it if I could but that will have to wait.
Thinking further: I will probably dispense with one of the buttons. So if you are on the English page you see the Spanish flag button and vice-versa.
Of course, I still have to choose a mechanism to do the actual inclusion. I was thinking PHP, in which case all my pages would have to be .php's - Is there any downside to this? How about the w3-include-html attribute?
Regarding the cookie debate: maybe when the user clicks to change language a popup simply asks:
"Would you like us to save this choice for future visits (using a cookie)?"
Copy link to clipboard
Copied
well, nice to see you back...
refer to the very first comments of this thread, OSGood and I gave you some JS script that could handle what you're expecting...
just let us know
Copy link to clipboard
Copied
How about the w3-include-html attribute?
========
Why would anybody use that???!!! That's an ugly, complicated mess.
There is no downside to using PHP files if your server supports PHP code.
PHP include statements are simple and straightforward with one line of code.
<?php require_once('Includes/header.html'); ?>
Would you like us to save this choice for future visits (using a cookie)?
========
Either the end user's browser accepts cookies or it doesn't. By default, all browsers accept cookies unless settings are intentionally changed by the end user, corp / gov't IT dept or security software. In those cases, asking will make no difference because the cookie cannot be saved.
If you suspect a big chunk of your target audience have cookies disabled, use server-side PHP sessions instead. Sessions are more reliable.
Copy link to clipboard
Copied
How about the w3-include-html attribute?
========
Why would anybody use that???!!! That's an ugly, complicated mess.
There is no downside to using PHP files if your server supports PHP code. (my emphasis)
By @Nancy OShea
"If" is the key - I'm still waiting for an answer from my host re: PHP. Looking at alternatives in case. Can always change service but may be an easier solution if another method was viable .
Copy link to clipboard
Copied
For Linux hosting, use PHP code.
For Win IIs hosting, use ASP.net code and Visual Studio Code editor which is made by Microsoft.
Copy link to clipboard
Copied
For Linux hosting, use PHP code.
For Win IIs hosting, use ASP.net code and Visual Studio Code editor which is made by Microsoft.
By @Nancy OShea
Hi Nancy. I am finally back in operation and ready to start tackling this issue again. I don't see myself using PHP for anything more than including headers, menus etc. with "include...". All I want to do is test pages locally before uploading to my host server. But to do even this much I understand I need to setup a server on my PC. When I look to activate the IIS feature in Win10, there are a bunch of options - Which of these do I need?
Then I also need to install ASP.net. and then PHP - Any more? I have searched quite extensively but it gets too technical too quickly. What I really need is a guide for total dummies on how to install the very basics and then run them. I am mostly using VSCode these days.
Copy link to clipboard
Copied
None of the above. Install Wamp and you have your server. Then use the `www` folder for your sites.
Copy link to clipboard
Copied
What Ben said. Install WAMP server.
In DW, define your local testing server by going to Site > Manage Sites. See screenshots below.
Local Site Folder
Add testing server
Path to localhost
Server model
Final screen
I also highly recommend that you disable Real-Time Preview in Preferences. Switch to Default to Static Browser Preview.
Preferences > Real-Time Preview
Copy link to clipboard
Copied
By @GaleodanI was thinking PHP, in which case all my pages would have to be .php's - Is there any downside to this? How about the w3-include-html attribute?
yes, you will have to change all the html files to php, for that purpose, first make a save back up of the main folder, then you have many choices for handling the batch process...
as you're under windows, you can run
https://www.thewindowsclub.com/batch-rename-files-extensions-windows
or as you're a Creative Cloud member, you can run Bridge
https://wikis.utexas.edu/display/comm/Adobe+Bridge+-+Batch+Convert+file+names+or+extensions
Copy link to clipboard
Copied
yes, you will have to change all the html files to php, for that purpose, first make a save back up of the main folder, then you have many choices for handling the batch process...
By @B i r n o u
No problem - There are no pages yet - Starting from scratch anyway 🙂
I won't be salvaging anything from the old pages - Just the texts...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now