Utilising / Formatting Multiple Calendars

Help with installation and general calendar setttings

Utilising / Formatting Multiple Calendars

Postby kevb8ll » Fri Feb 03, 2012 2:10 pm

Well 2! :D

I am putting together a site for someone who has 2 holiday cottages, and this is exactly what we need. After my initial problems with setting up, I now have created 2 availability calendars (ID 2 and 3).

I have a couple of questions.

1. I want to show the two calendars seperately on seperate pages. How should I do that?

2. I have edited the css file, but the changes aren't being picked up in the admin page - is that normal? I assume when I get the calendars on the pages I have, it'll work.

Kev
kevb8ll
 
Posts: 12
Joined: Fri Feb 03, 2012 12:11 pm

Re: Utilising / Formatting Multiple Calendars

Postby kevb8ll » Fri Feb 03, 2012 2:19 pm

I've answered question 2, that is OK - but I have the 2 calendars on the drop down at the top of the page - is there any way of linking directly to calendar 1 on one page and calendar 2 on a different page with no drop down menu?
kevb8ll
 
Posts: 12
Joined: Fri Feb 03, 2012 12:11 pm

Re: Utilising / Formatting Multiple Calendars

Postby chris » Fri Feb 03, 2012 3:41 pm

Hi,
Assuming that you are using the iframe method you simply need to add ?id_item=X (where X is the calendar id) to the url.
If you have implemented this using PHP you need to define the id before you include the calendar file by defining a GET variable like this:
Code: Select all
$_GET["id_item"]=X;


Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Utilising / Formatting Multiple Calendars

Postby kevb8ll » Fri Feb 03, 2012 3:54 pm

Hi Chris

I'm using this in a wordpress install, so that would account for the ?id_item=X not working.

Where do I need to put the "get" command? Does it go in as code on the WP page or as a global on the page template?

I have x2 calendars id-2 & 3 I assume I will need a different get command for each?
kevb8ll
 
Posts: 12
Joined: Fri Feb 03, 2012 12:11 pm

Re: Utilising / Formatting Multiple Calendars

Postby chris » Fri Feb 03, 2012 5:27 pm

I'm afraid that I have no idea about Wordpress :(
In the calendar file that you are including in wordpress you need to place the GET before this line:

Code: Select all
$the_file="ac-includes/cal.inc.php";


Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Utilising / Formatting Multiple Calendars

Postby kevb8ll » Fri Feb 03, 2012 8:51 pm

I've been playing and have got it working by using:

Code: Select all
<iframe width="670px" height="900px" src="mydomain/index.php?id_item=1&#38;lang=en" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>


(With a bit of help from a friend!)

A totally different question. Is it possible to remove some of the key items as I won't be using some of them in my application.

Kev
kevb8ll
 
Posts: 12
Joined: Fri Feb 03, 2012 12:11 pm

Re: Utilising / Formatting Multiple Calendars

Postby chris » Fri Feb 03, 2012 9:03 pm

A totally different question. Is it possible to remove some of the key items as I won't be using some of them in my application.

Yes, you can deactivate or remove them via the calendar admin panel as required


Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Utilising / Formatting Multiple Calendars

Postby kevb8ll » Fri Feb 03, 2012 9:57 pm

Cheers mate.
kevb8ll
 
Posts: 12
Joined: Fri Feb 03, 2012 12:11 pm

Re: Utilising / Formatting Multiple Calendars

Postby vicmontol » Wed May 02, 2012 9:23 pm

@chris Nice work, useful & easy. Quick (noob) question related to this post.

I`d like to use the calendar for showing booking dates in different houses
The <iframe> above solution is awesome if my item webpage id is similar to calendar item (i.e. www.mipage.com?item=456 loads: www.mipage.com/calendar_dir/index.php?id_item=456)

But if my item pages id are different that my calendar id, I thought that I could use the field "id_ref_external" on bookings_items table to do it.Just want the same result as above.

Tried unsuccessfully:
1) Storing my page id value in a php variable before the <iframe>tag in my template and use it in <iframe src=".....index.php?id_ref_external=$myphpvariable

I think that solution is easier than I thought but I'm stucked. any clues or ideas are welcome!

Kept supporting this nice calendar. Tnx
User avatar
vicmontol
 
Posts: 1
Joined: Wed May 02, 2012 9:09 pm

Re: Utilising / Formatting Multiple Calendars

Postby chris » Tue May 15, 2012 1:19 pm

Hi,
To show the calendar for each item you just need to note the id of the calendar item in the admin panel and add it to the iframe url for the item that you want to show.

The id_external_ref is not actually used by the code.

If you are creating the calendar page dynamically you will need to store the relationship somewhere - this is where the external id field could be used but you will need to modify the calendar code to "know" that it needs to use the external_id field when retrieving calendar data as opposed to the default primary key id field.

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron