Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Creating a Time Table that Changes Articles

Creating a Time Table that Changes Articles

I need to figure out how to make the code for a time table like this. Also will the articles automatically refresh based on the scheduled times?

I did the table as best as I could with out an actual grid, so if you have any questions please let me know.



Thank You!

Zmoney
Beginner Modder
ranks
useravatar
Offline
1 Posts
Administrator has disabled public posting

Re: Creating a Time Table that Changes Articles

Hi Zmoney,

the problem is that MetaMod deals only with modules, not with articles. So if you're hoping to change the article that appears for a given menu item, MetaMod isn't going to help that.

Now, there are some workarounds for that. e.g. there are some modules available on the JED that can display an article inside the module.

In that case you might create a minimal (e.g. blank) article to show as the menu item, then on that page you would assign a MetaMod into a module position that displays full width, right below the article. Or, in the article you could use a {loadposition} tag that loads in a MetaMod assigned to that position. Either way, the point is that if MetaMod is going to be your solution to the problem, then it needs to be displaying modules. What type of modules they are, and what is in them, is up to you.

So let's say you decide to use the {loadposition timetable} thing inside a blank article.

Then:

1 - create all your articles and save them
2 - find a suitable module on the JED to display an article in a module
3 - create a separate module for each of the articles you want to display (HH1 to HNY). Take a note of the module IDs.
4 - for each of those modules, set them to module position "formetamod" (just as a random position, to keep them together)
5 - create your blank article with only {loadposition timetable} in it, and create a menu item to point to it
6 - create a MetaMod. Put it in module position "timetable". Make sure it's published. It doesn't matter what menu items it is assigned to.
7 - in the MetaMod, use the following PHP:

if ($core_genius->inTimeSpan("2012-11-25 - 2012-12-24")
  and $core_genius->inTimeSpan("08:00 - 13:59:59") // assume you meant 14:00 not 02:00?
  and $core_genius->inTimeSpan("mon; wed; fri")
) return AAA; // replace AAA with module id for HH 1

if ($core_genius->inTimeSpan("nov 25 - dec 24")
  and $core_genius->inTimeSpan("14:00 - 19:59:59") // assume you meant 14:00 not 02:00?
  and $core_genius->inTimeSpan("tue; thu; sat; sun")
) return BBB; // replace BBB with module id for HH 2

if ($core_genius->inTimeSpan("dec 25 - dec 27") // last day on the 27th?
  ) return CCC; // replace CCC with module id for MC


if ($core_genius->inTimeSpan("dec 28 - dec 30")
  ) return BBB; // replace BBB with module id for HH 2

if ($core_genius->inTimeSpan("dec 31")
  ) return DDD; // replace DDD with module id for NYE

if ($core_genius->inTimeSpan("jan 1 - jan 31")
  ) return EEE; // replace EEE with module id for HNY


You can find out more about the inTimeSpan syntax and capabilities on this page:

http://www.metamodpro.com/jomgenius/par … intimespan

Note that this does not handle years, but you can simply unpublish the module after January so it won't recur the following year. Or you could actually build it into the PHP but it might not be worth it.

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Total Posts Today:
1
User Info:
 
Total Users:
10075
Newest User:
rsker57
Members Online:
0
Guests Online:
248

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked