include master card into sub cards

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

include master card into sub cards

Post by jalz » Fri Dec 19, 2014 7:46 pm

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

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: include master card into sub cards

Post by Klaus » Fri Dec 19, 2014 8:22 pm

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

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: include master card into sub cards

Post by jalz » Fri Dec 19, 2014 9:43 pm

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

Post Reply