I’ve seen it running fine with Evo on someone else’s site already, but I haven’t set up an Evo test site myself yet (perhaps this weekend). There’s certainly no reason why it shouldn’t work with Evo (and if there are any problems then I’d like to fix them) - so please try it out.
Does YAMS works with EVO 1.0? or only with 0.9.6.x?


You’re right, you shouldn’t see both sets of fields on both tabs. I have never seen that before. Are you using the latest version of ManagerManager and do you have any custom rules specified in addition to the YAMS ones?
I do have one question regarding the use of ManagerManager and "hiding" redundant fields while editing a resource. For example, I have English and French, and whenever I edit a page I have the 2 extra tabs at the top (one for English and one for French) both sets of inputs (en + fr) appear on both pages. Shouldn’t only the en fields appear on the English tab and only the fr fields appear on the French tab? I forgot to mention that I do have "Hide fields" selected for "Hide Redundant Fields" in the "Other Params" tab of YAMS.
@PMS - Let me know if I understand how YAMS works properly, in the template we use [*content*] but there are TVs for [*content_en*] and [*content_fr*] ... the actual translated fields. Does YAMS hook into the parsing of the template and replace [*content*] with [*content_{lang}*] where {lang} is the active language?
One last thing could you give any insight on the possibility of translating the alias as well? I really need translated, SEO-friendly URLs.
You’re right, you shouldn’t see both sets of fields on both tabs. I have never seen that before. Are you using the latest version of ManagerManager and do you have any custom rules specified in addition to the YAMS ones?
<?php
// MM rules can go in here, instead of a chunk
// If you copy them to a chunk, don't include the opening and closing PHP tags
// ------------------------ INSERT YOUR RULES HERE --------------------
// These are example rules -- replace them with your own
// PHP *is* allowed
require( $modx->config['base_path'] . 'assets/modules/yams/yams.mm_rules.inc.php' );
// News editors role -- creating a variable makes it easier to manage if this changes in the future
$news_role = '3';
mm_hideFields('pagetitle,menutitle,link_attributes,template,menuindex,description,show_in_menu,which_editor,is_folder,is_richtext,log,searchable,cacheable,clear_cache', $news_role);
mm_renameTab('settings', 'Publication settings', $news_role);
mm_synch_fields('pagetitle,menutitle,longtitle', $news_role);
mm_renameField('longtitle','Headline', $news_role, '', 'This will be displayed at the top of each page');
// News story template
$news_tpl = '8';
mm_createTab('Categories','HrCats', '', $news_tpl, '', '600');
mm_moveFieldsToTab('updateImage1', 'general', '', $news_tpl);
mm_changeFieldHelp('longtitle', 'The story\'s headline', '', $news_tpl);
mm_changeFieldHelp('introtext', 'A short summary of the story', '', $news_tpl);
mm_hideFields('menuindex,show_in_menu', '', $news_tpl);
mm_changeFieldHelp('parent', 'To move this story to a different folder: Click this icon to activate, then choose a new folder in the tree on the left.', '', $news_tpl);
// For everyone
mm_default('pub_date');
mm_renameField('introtext','Summary');
mm_changeFieldHelp('alias', 'The URL that will be used to reach this story. Only numbers, letters and hyphens can be used');
mm_widget_tags('blogTags'); // Give blog tag editing capabilities to the 'blogTags' TV
mm_widget_colors('colour', '#666666'); // make a color selector widget for the 'colour' TV
mm_widget_showimagetvs(); // Always give a preview of Image TVs
// For everyone except administrators
mm_hideFields('link_attributes', '!1');
//mm_moveFieldsToTab('tvcolour', 'general');
mm_default('richtext', 0);
// ------------------------ END OF RULES --------------------
?>
Please try putting the YAMS rules at the end, or commenting out the default manager manager rules. (There’s no point manipulating document variable fields that you are subsequently going to hide anyway.)
Quote from: PMS at Aug 06, 2009, 05:04 AMYou’re right, you shouldn’t see both sets of fields on both tabs. I have never seen that before. Are you using the latest version of ManagerManager and do you have any custom rules specified in addition to the YAMS ones?
I’m running MODx v1.0.0 + ManagerManager v0.3.2 + YAMS 1.0.4a-rc3 and set it up exactly as described in the docs with no additional MM rules (other than the default ones shipped with MM).
assets/plugins/managermanager/mm_rules.inc.php
Regarding translatable URLs, I’m going to start digging through MODx + YAMS and see if I can figure it out based on what you’ve said. It’s an absolute must that I have this so I *will* figure it out
PS - In step 12 of the docs you use [[yams? ...]] as the snippet example but according to the docs we create the snippet using ’YAMS’ as the name - hence the snippet should be [[YAMS? ...]]
Please try putting the YAMS rules at the end, or commenting out the default manager manager rules. (There’s no point manipulating document variable fields that you are subsequently going to hide anyway.)
Yes. A documentation bug. Will fix straight away. Well spotted!
Please can you try updating your ManagerManager to the latest version to see if that makes a difference? 0.3.2.1
Quote from: PMS at Aug 06, 2009, 05:57 AM
Please try putting the YAMS rules at the end, or commenting out the default manager manager rules. (There’s no point manipulating document variable fields that you are subsequently going to hide anyway.)
I removed everything but the YAMS rules include - it had no affect.
When it comes to writing high quality software, that’s a compliment. Glad to receive any feedback you have, no matter how nit-picky.
Some people call me a nit-picky detail freak.
Please can you try updating your ManagerManager to the latest version to see if that makes a difference? 0.3.2.1
<?php
require_once( dirname( __FILE__ ) . '/class/yams.class.inc.php' );
$evt = &$modx->Event;
switch ($evt->name) {
case 'OnPageNotFound':
$yams = YAMS::GetInstance();
$lang = $yams->GetCurrentLangId();
$docId = $this->getDocumentIdentifier('alias');
$this->db->connect();
$tv_table = $this->getFullTableName('site_tmplvars');
$tvc_table = $this->getFullTableName('site_tmplvar_contentvalues');
$sql = "SELECT tvc.contentid
FROM $tv_table tv, $tvc_table tvc
WHERE tv.name='alias_$lang'
AND tv.id = tvc.tmplvarid
AND tvc.value = '$docId'";
$result = $this->db->query($sql);
$count = $this->recordCount($result);
if ($count == 1) {
$row = $this->fetchRow($result);
$docId = $row['contentid'];
$this->sendForward($docId);
exit();
}
}
?>$lang = $yams->GetCurrentLangId();
$activeLangIds = $yams->GetActiveLangIds();
$docId = $this->getDocumentIdentifier('alias');