Page 1 of 1

include master card into sub cards

Posted: Fri Dec 19, 2014 7:46 pm
by jalz
Hey all,

Looking at revamping my interface during these holidays and was wondering whether I could do the following with LiveCode. Is it possible to create a card, lets say for arguments sake call it Top. Within that card I will know exactly what width and height it is and the positions of the logo, fields, labels etc. I want this card to eventually be the header of my application on each card.

What I am asking is whether we can achieve the following php behaviour with cards. With php, you create a file called top.php, format all the objects as you would like and then when you are happy with it you can "include" the contents of that page into other pages. If you make a single change to the top.php file, the change is filtered through the entire website saving time. Is it possible to do something like this in Livecode. I suppose you can copy the contents of the top card and paste and position them on each card on the pre open card handler but is there an "include" equivalent in LC?

Thanks
Jalz

Re: include master card into sub cards

Posted: Fri Dec 19, 2014 8:22 pm
by Klaus
Hi Jalz,

maybe you just want to add a BACKGROUND group to all of your cards?
DEFINITIVELY sounds like it! :D

PHP is obviously serving a html frame with top.php, so this is not applicable here.


Best

Klaus

Re: include master card into sub cards

Posted: Fri Dec 19, 2014 9:43 pm
by jalz
Hi Klaus,

A background group works perfectly for a header across the entire app. I was toying with the idea to load various cards within a card template depending on whether the user was browsing or editing a record in my app hence I was thinking of the include feature to avoid creating two cards almost identical. Although having thought about it I think I can use the one card and get the desired functionality by playing with the properties of the object.

Thanks as always
Jalz