-
- 3 Posts
I am using MODX Evolution. I need to create custom pagetitle value which will be automatically built from unique tv values of current document i.e.:
[*proposal-current-number*][*producer*][*product-model*]
Each tv is a simple string.
Could you help me to prepare any smart, simple plugin to change this system field value during editing/creation of current document (onDocFormSave event)?
Maybe my question is trivial or was discussed here earlier, but I can't find it. Additionally, I'm not a php programmer...
Thanks in advance
Tad
-
- 3 Posts
Thank you for your advice.
In general you're right - it's good idea, but I am going to do a step ahead - I need to build coherent system where all important data of each document will be included in the system fields. And additionally, I would like to create unique alias based on the pagetitle value for each this way created document - simply for Google indexing, and as I checked TransAlias is a good ready-to-use solution.
There is a part of my project - section with second-hand car dealer business. In this section, each current offer (document) will be created few times daily by customer itself. It will contain a few images, table with technical data, etc. In such case back-end operations must be simplest as much as possible because will made by unexperienced user.
That's why I need to automate document creation process - using dedicated template, a few tv's and scripts needed for describe current proposal. It's something like standard e-shop solution but limited to presentation layer only. No one shopping cart, storage or payment modules.
But problem is that all MODX e-shop modules are too much sophisticated for my needs.
So, I still prefer "plugin" solution as most elegant and effective.
I found Bob Ray's article with relatively simple plugin adaptable for my needs:
/* Do nothing if it's not a new resource */
if ($mode !== modSystemEvent::MODE_NEW) {
return '';
}
$introText = $resource->get('introtext');
$resource->set('description', $introText);
$resource->save();
return '';
but syntax of the code is from MODX Revo...
[ed. note: tadeusz last edited this post 8 years, 5 months ago.]