Page 1 of 1

New Functionallity to Archive Pages

Posted: Mon Feb 26, 2018 1:53 pm
by BlakesHeaven
Hello, This has been touched on before (old topic here), however, I don't think it got anywhere.

I'll have a go myself (probably struggling), but I don't really want a non-standard application so I'll outline my thoughts and reasons.

Background: The website is for a Concert Club and lists the 'Current' programme and sometimes prior to roll-over the 'Next' programme. Each programme will have six events with the Parent page as the summary of all six events and the six child pages contain the event detail.

We could just delete old programmes once they move into the past, however, I would like to move them into a separate 'Archive' section.

I have played with Tags, Categories, different Status values and future scheduling, but it always comes back to, they must be published and past the scheduled date to be reachable and if they are reachable they appear in Menus, Latest Events, Categories; which I don't want.

I work with C# developers as a DBA and know enough that although a concept is simple, the coding is not; so forgive me when I outline my concept if it seems I make light of the coding required. :)

So... I see two approaches (my preference is the second ;) ):
1. Add a new status of "Archived". This would be a manual task for the Admin/Editor to change the status. Once changed, it would exclude them from appearing in Menus, Latest Events, Categories, etc... but they would still be reachable and viewable.

2. Change "Date" to "Activation Date" (I'd do this anyway) and add an "Expiry Date" selection and a checkbox labelled, "To Expire". If ToExpire == True and the ExpiryDate <= GetDate() the item is expired and automatically "Archived".

So... (and this applies to both the above), what happens to archived pages?
  1. They appear in a new "Archive" plugin list if the Archive Plugin is activated.
  2. They are still published and viewable if direct URL is known or "Archive" plugin is enabled
  3. They are excluded from Menus, Latest Events, Categories, etc
  4. If a parent is Archived, all children are archived.
  5. Children can be archived ahead of the Parent.
  6. The Archive list would be theme driven, but I'd place it on the left menu under Menus, Latest Events, Categories, but above the Links menu.
  7. Archived pages can appear in Tags
3. Options:- Under page content "Advanced" section there could be an option to set if individual pages should appear in Archived. If True they appear if not they just expire. I would personally set the Parent page to appear and the children pages not to appear on the basis that the parent page will have a url link to the children anyway. Could also have separate options allow viewing through Tags, etc.

I'd see the Archive list as looking like this:
  • 2018 01-04 (a parent page)
    • A child page
  • 2017 09-12
  • 2017 05-08
Many thanks for listening/reading.
I see this as a great addition to Bludit 8-)

Re: New Functionallity to Archive Pages

Posted: Mon Feb 26, 2018 5:35 pm
by Edi
There are a lot of solutions for your "problem". Why not rename the content, add a category or a tag? And perhaps copy an existing plugin with a navigation and modify it to your needs?

Re: New Functionallity to Archive Pages

Posted: Sun Mar 04, 2018 4:08 pm
by BlakesHeaven
Hi, I have undertaken the development of a new plugin that fits my needs, which I'll try and post up on GitHub once finished. I know T-SQL and I'm learning a lot, but clearly, I'm not a PHP developer and ... ... (big edit of post) ... ... this post was to be a call for help.

I previously wrote:My IF statement is not doing what it should be doing

Code: Select all

if (strtotime( $Parent->date() ) < @archiveEpoch ) {
Any help would be appreciated.
And, it went on for some length showing bits of code...

... but I spotted my error - In T-SQL, I am so used to starting variables off with "@", that a few crept in :oops:

Once spotted and changed for the "$" it suddenly started to behave.

Now I need to work out how to place my plugin above the "Other Links" plugin... though I might have spotted something.

Re: New Functionallity to Archive Pages

Posted: Sat Mar 17, 2018 11:32 pm
by BlakesHeaven
Hello, I now have a working plug-in I have called,
I don't know how to get it into the Bludit area for general use but it can be found in my GitHub area here.

I'm still adding some features/enhancements, but I wanted to share it now as I'm using it myself on a LIVE site.

Think of a conveyor-belt...

... Published content moves through three different sections automatically based on the published DATE:
  1. "Upcoming" menu section
  2. "Current" menu section
  3. "Archive" menu section
All sections are configurable:
  • Set if the section is active or not (excluding "Current")
  • Section label names can be changed
  • Set if children should show or not
  • For each independent section, set the duration of time (weeks at the moment) content appears in it
  • What to do about nothing? Automatically shows or hides the section label if no content is found
  • Fill-in text if nothing is found and the label is shown <-- in progress.
  • If "Upcoming" menu section is disabled, "Current" menu section automatically starts immediately.
Oh yes; there are a few more features as well...
  • Hide pages with a named Category.
  • A built-in "Static Menu" - based on the standard Bludit "Static Menu" plugin, but honouring the hidden pages category.
  • Enable/Diable Homepage withing Statice Pages
Built initially to auto-archive a programme of events for a concert club after a number of weeks had elapsed but became a little more than that.

Re: New Functionallity to Archive Pages

Posted: Sun Mar 18, 2018 1:43 pm
by Edi
Thank you very much for your contribution!

I added the plugin to the repository.

By the way there is a description how to add a new plugin here:

Re: New Functionallity to Archive Pages

Posted: Thu Mar 22, 2018 12:15 pm
by BlakesHeaven
Edi wrote:
Sun Mar 18, 2018 1:43 pm
I added the plugin to the repository.
By the way there is a description how to add a new plugin here:
Thank you very much Edi.

There was a slight blip yesterday/today with missing files on my GitHub repository - probably down to me doing something wrong. I think you're already aware of this, but FYI I re-uploaded the files this morning.

Anyway, I am continuing to work on this plug-in in both tidying up my code, adding other languages and new features I had in mind. The first being a configurable time-type: choose between Week/Month/Year instead of fixed to Week only. :)


Re: New Functionallity to Archive Pages

Posted: Sun May 06, 2018 11:33 pm
by BlakesHeaven
Just a quickie to say I have pushed up a version update so that my "Auto-Archive-Menu-Plus-More" plugin now works on Bludit version 2.3.4.

There are now two subfolders in the zip, one for 2.2.x and one for 2.3.x


Re: New Functionallity to Archive Pages

Posted: Mon May 07, 2018 9:41 pm
by Edi
Great! The repository is updated with the latest version.

Re: New Functionallity to Archive Pages

Posted: Sat Jun 09, 2018 10:31 pm
by BlakesHeaven
Hi, I have added an update to the "Auto-Archive-Menu-Plus-More" plugin:
a new menu section has been added so that if an Admin or Editor is logged in, an extra menu shows. Designed for Admin documentation to be added and hidden from the general public.
NB: It's only a menu - pages are still accessible if the URL is known.
It is aimed at normal Published pages so that Parent/Child relationship can be adopted and is driven by a Category of your choice.
Edi, Can the current repository path in " auto-archive/metadata.json " be changed from:

Code: Select all

"download_url": "",
Back to this:

Code: Select all

"download_url": "",
I am keeping separate folders for each version of the plugin within the - that way I won't need to bother you to update the repository link and people can easily get to all the plugin versions.

Thanks Edi. I looked but don't think I can do this myself; though I'm not surprised :)

I was also planning to reply to this forum post with any further updates as and when I do any. 8-)