Is it at all possible to set a TV at the user level, so you can change them for each user say within a snippet ?
I have been playing with extended fields but you cant sort or anything based on that. Any help or guidance is appreciated.
-
☆ A M B ☆
- 3,112 Posts
do you mind to state your modx's version?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
-
☆ A M B ☆
- 3,112 Posts
So user level means web context user (front-end)?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
Hello,
Yes the front end of modx. I am trying to customize the layout for the user based on previous "goals" they have completed each goal being a resource.
Thanks for the help
-
☆ A M B ☆
- 3,112 Posts
I try my shot.
I made a TV:
name:
pickOne
input type: radio options
value:
apple==a||blueberry==b||cherry==c||durian==d
Then I make a snippet:
name:
selectOptions
code:
<?php
$tv = $modx->getObject('modTemplateVar', array('name' => 'pickOne'));
$elements = $tv->get('elements');
$options = $tv->parseInputOptions($elements);
$o = '<form name="bla-bla" action="">';
foreach ($options as $opt) {
$vals = @explode("==", $opt);
$o .= '<input type="radio" name="group1" value="' . $vals[1] . '"> '
. $vals[0] . '<br>' . "\n";
}
$o.= '</form>';
return $o;
Then try to call in your resource as [ [!selectOptions] ]
Is this what you're up to?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
-
☆ A M B ☆
- 24,524 Posts
A TV is a value for each page, regardless of who accesses it.
If you want these options to be remembered for each user, you'll need to use a custom form and save to cookies. Or if they're logged in, you'll need to save to the database and retrieve next time they log in. Formit has a hook available to save to the database, and another one to fetch from the database.