Back in the good ol' days of Microsoft Expressions Web 2 & 4, I maintained a pile of replaceable Index pages covering such things as Breast Cancer Awareness Month, Marine Corps Birthday, and most major holidays. I simply uploaded the proper Index page for the day or week necessary.
Now, I realize that this topic has been discussed at length with various work-a-rounds. Finally got a moment and attempted a couple that appeared solid but Xara tore it apart.
It was suggested to open the .zar and delete all unnecessary pages. Then save the Index page remaining under a new name. Didn't work too well as it also deleted all now unnecessary links including menu bars.
It was also suggested to simply copy the needed page, open a new page and paste in. Kinda worked but didn't preserve background and formatting. Another fail.
Perhaps I was missing a step... causing failure.
Thus, I now make little changes, backup the HTML Index at the host, upload the new Index, and when its purpose has been completed, delete, rename the backup. Back in business. Much too much problem for 2017.
Is there a better path to Index Nirvāṇa?
Thanks,
Randy
12 February 2017, 09:54 PM
Acorn
Re: Event Specific Index pages
Randy, you could try a bit of JavaScript in the head of your index page, along the lines of:
Quote:
<script>
var currentTime = new Date()
var dt = new Date(2017,2,22,7,0,0); // months in JavaScript are 0-11
if (currentTime > dt ) {
window.location = "BreastCancerAwarenessMonth.htm;";
}
var dt = new Date(2017,3,22,7,0,0); // months in JavaScript are 0-11
if (currentTime > dt ) return;
var dt = new Date(2018,10,1,9,0,0); // months in JavaScript are 0-11
if (currentTime > dt ) {
window.location = "MarineCorpsBirthday.htm;";
}
var dt = new Date(2018,10,2,9,0,0); // months in JavaScript are 0-11
if (currentTime > dt ) return;
</script>
The named pages would be placed permanently in your site but only accessed on this redirection.
If neither were valid the return command keeps you on the index page.
I did it this way to avoid if then else constructs but that is another approach.
Nothing above has been tested, just my musings.
Acorn
12 February 2017, 09:57 PM
angelize
Re: Event Specific Index pages
As this is a web design question I've moved it to Xara Web Design Chat :)
13 February 2017, 03:19 AM
Egg Bramhill
Re: Event Specific Index pages
Quote:
It was also suggested to simply copy the needed page, open a new page and paste in. Kinda worked but didn't preserve background and formatting. Another fail.
How are you copying the page? I've tested it and it imports everything including background & formatting.
This is how I did it:
In the Page & Layer Gallery, moused over the index page, right click & select 'Copy Page Index'.
Open a new web document.
Again, in the P&L Gallery, right click and select 'Paste Page Index'.
You might get a box asking if you want to match Text Styles & Colours. Select 'Don't Match'.
This page will now be a complete replica of the site page you copied it from.
Obviously any navbars using relative links become meaningless but if they use absolute links they will function.
13 February 2017, 03:20 AM
R Duane
Re: Event Specific Index pages
Acorn,
To this lay person, it appears an elegant solution. And just off the top of your head... a tip of the hat sir.
I'll give it a try. See if I can make it functional for me. Perhaps another in this forum will also accept the challenge... perhaps even the primary Xara coders to assist us "mortals."
May Spring be sooner than later,
Randy
13 February 2017, 03:22 AM
R Duane
Re: Event Specific Index pages
Apologies please.
Really thought I was in the correct place. Upon review, I see I wasn't.
All my best,
Randy
13 February 2017, 03:49 AM
R Duane
2 Attachment(s)
Re: Event Specific Index pages
Egg,
Thanks for the reply.
The answer is yes... exactly as you did.
Here's what happened... ScreenShot036 is what I wanted, ScreenShot037 is what I received.
As this was my first project with Xara Designer Pro X11, there could be all types of "user" induced errors involved.
Finally, as this is my only Xara project, family biz and all, whenever I get back into the program I have to relearn it all over again. Yes, we do have a professional web developer in the family... but this provides this retiree something to do... while he is free to earn both customers and an actual income.
Thank you very much,
Randy
13 February 2017, 04:06 AM
Egg Bramhill
Re: Event Specific Index pages
Hi Randy,
Then I can't understand what's going on here. It's obvious that your original page is wider than the pasted page. This is wrong. Can you attach a xar file?
13 February 2017, 05:35 AM
R Duane
1 Attachment(s)
Re: Event Specific Index pages
Egg,
First I must say your dedication is exemplary, working posts at YOUR time of the morning. Me, I've just tossed a few logs on the fire for the sleeping hours.
Anyway, I've reduced my .xar down to the "home" page... but I think that will provide what you asked for as all other pages are derived from Home/INDEX page. Now I have to find the attachment icon and all will be well with this post. Let me know if "files" are required.
Again,
Thank you very much... BUT, please don't find too much wrong... I don't know if I could ever recreate this thing.
Best regards,
Randy
14 February 2017, 05:02 AM
Egg Bramhill
Re: Event Specific Index pages
Hi Randy,
Maybe this will help?
By the way, loved the Valentine Video. I shared it on Facebook, just awaiting the feminist backlash :)
14 February 2017, 06:10 AM
R Duane
Re: Event Specific Index pages
Egg,
I want to thank you so much for creating the visual aid. Immediately seen the error in my procedure. The copy was correct. The paste was not. Instead of using File>New I was adding a new page with the "plus" tab and then Paste Page in the P&L gallery. That resulted in the weird structure.
And yes, the white page background at approximately 75% was intended... something just a little different from the rest.
Now past 0100 and time for bed,
Again, thank you,
Randy
10 April 2017, 06:29 PM
R Duane
3 Attachment(s)
Re: Event Specific Index pages
Re: Event Specific Index pages (14 February 2017, 12:02 AM)
Egg,
Again thank you very much for your previous post and visual aid you created for me.
Yesterday I attempted to re-create for myself what you instructed me on... yes, it was successful.
First I did copy my index page and create a new web page and paste the page and contents properly. That part seems sorted.
I then modified by removing certain content and adding new content. This initially appeared proper by viewing current web page. I then saved under new title (index_unique-name).
Following your instructions again; in Page & Layer Gallery, I copied index_unique-name.
At this time I wasn't sure what to do so I went back to the Page & Layer Gallery of the active website and then paste page index_unique-name in. Deleted original index page and adjusted Xara's auto corrected nav bar.
Again, results appeared correct when I previewed the current web page (SampleWCL_index01)... yet, when I previewed the whole website, the page was correct in regard to content but page size was double wide (SampleWCL_index02) while the rest of the web site was viewed properly (SampleWCL_index03).
I'm sure the issue I'm seeing in operator induced... but I don't know where or how. Your thoughts please.
Thanks
Randy
10 April 2017, 11:36 PM
Egg Bramhill
Re: Event Specific Index pages
Hi Randy,
I'd really need to see the web/xar file to know for sure.
Try opening Utilities/Options/Page Size and check All pages in document the same.