hi,
Let's say I have a page. This page has a first paragraph as introduction which would be "content" tag
Then it has 2 other blocks with more text. How do I handle this so that the user can edit each block seperatly ?
Many thanks
-
☆ A M B ☆
- 24,524 Posts
That's what TVs (Template Variables) are for.
There are many ways to go Modx:
two of them:
use tv's to set the chuncks that make up the layout and content of a resource. (chunck parser)
use a template for each page layout made off layout html elements (chuncks) and use extra tv's for the page specific extra content elements like images, prices, tags, etc
handy:
tv's are easy to group by category an you can make them applicable for specific user roles.
so you for example can set layout tv vars , client the content related ones.
Just go and play with modx and you will see the greatness of it. It's al up to you how you wan't it.
Before starting in modx save yourself some time and follow some tutorials to get you started, there are many.
you need to grasp these elements
template/chunck/snippet/tv/getresource/getpage/tpl's
before building so you can choose the right way of making you web-thing , thing because with mentiond elements and other beautifull stuff in Modx you can make everything you can think of.
Grtz Hurby
Sommige mensen hebben aan een half woord genoeg
lets say you want a pagelayout for home, one for pages, one for contact, one for portfolio.
make 4 templates.
Elements that you want in all pagetypes become chuncks. for example a top menu, a head
use the standard things like content, title, introtext, longtitle etc in youre templates and chuncks
Inside these chuncks and templates you place tv's where you want editable and page specific values, like metatags for example.
a tv can be almost anything a video, a value a date, number etc.
So: a head chunck for all templates with in there a tv for metatags and the standard title var. (let's say standard vars are standaard tv's allready there....)
tv's come in different kinds so yo can ouput everything you want anywhere you want and even make you own, but forget that for now.
hope this helps a bit more in understanding the difference , i,m dutch so excuse my english grammar
some people get confused by the name of chuncks in getresource calls for example "tpl"
tpl and chunck are the same things basicly, a bit confusing, plugin;s and snippets ask for tpl's (= chuncks...) to output the data in the way you want.
So combine css and chuncks to make templates for needed page variants (layout)
set resources to the desired page template.
set tv value's like: text, metatags,images, etc for the resource.
and if i really suck in explaning dont't give up!
you may set tv value's in each resource so : yes you can *-)
grtz
Hurby
[ed. note: hurby last edited this post 15 years, 2 months ago.]
Sommige mensen hebben aan een half woord genoeg
Hihi ! No problem at all ... first of all I' french so my english can also sometimes be restricted and not as clear as I'd like it to be , second, there is no way i would complain about someone trying its best to help !!!! I actually thank you for your patience.... Now I think I did understand all those concept better ... the main concern I have is how do we adapt all this for a customer .... I mean my main problem is not that much about learning how to set up chunks or tvs .... I know I will have to spend more time to discover all this .... Right now I've just started to test the basic ... putting a template together and see how to manage the content and see if I can use it for clients ... What I'm trying to work out is if I can use this system to:
Create pages and provide customers with a straightforward panel ... they login , they have the menu on the left that says "homepage / introduction text / left box text / rightbox text" - "Page2 / main text/ banner right text" / - "Page3 / main text/ banner right text / imagebottom" etc etc ......
My main issue is (I might be a bit dumb as well hihi!!) so far I worked out the template thing, I have my homepage , with its content and 2 template variables for 2 other content blocks ... all fine ... what I can't work out now is .... if I create one more page based on the main template , It still contains the 2 template variables used in the homepage ..... I do not want those variables anymore as they are blocks designed only only to go on the homepage, the other page should not show those variables anymore but others ..... is that possible ?
Many thanks for your help!!
I guess that wil be the easiest ! Many thanks to all for your help.