Id like the add a manufacturer part code to the product URL. It is inside of a custom product field. Does URI management support custom fields when defining the url pattern?
Is it possible to use custom product fields in the URI Management
Collapse
X
-
Is it possible to use custom product fields in the URI Management
Calvin Nelson
Director of Web Development
2C Development Group
-
Re: Is it possible to use custom product fields in the URI Management
Not in the URI Template but you can use a page to generate all URIs with the custom fields and then import them. Or use Excel to build them an import them.
-
Re: Is it possible to use custom product fields in the URI Management
That is exactly what I needed! Duh! Didn't even think about doing that!Originally posted by Brennan View PostNot in the URI Template but you can use a page to generate all URIs with the custom fields and then import them. Or use Excel to build them an import them.Calvin Nelson
Director of Web Development
2C Development Group
Comment
-
Hello,
Originally posted by Brennan View PostRe: Is it possible to use custom product fields in the URI Management
Not in the URI Template but you can use a page to generate all URIs with the custom fields and then import them. Or use Excel to build them an import them.
Further to this:
1. In this document:
http://docs.miva.com/how-to-guides/h...uri-management
(in or near SECTION 8)
It would help if it were noted that custom fields cannot (currently) be used as part of URI Management templates. (Life would be easier if they did.)
2. Is it possible to "slugify" a custom product field within that page template described in Brennan's post? (I'm needing to slugify Manunfacturers' names, particularly those with more than one word for a company name.)
cheers,
Michael
Comment
-
Hello,
CustomFields actually can be used when generating URLs with URI management. The use of mvt:do will assist with that. Here is the code I used to insert a customfield when generating product URLs
<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" />
<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'CustomField_Code', g.CustomField_Code )" />
/product/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower( l.settings:product:slugified_page_title $ '-' $ g.CustomField_Code)" /><mvt:else><mvt:eval expr="tolower( l.settings:product:slugified_name $ '-' $ g.CustomField_Code )" /></mvt:if>.html
You can place this directly (without line breaks or spaces) into the URI template text field in URI Management. Replace 'CustomField_Code' with your custom field.
Comment
-
I've tried getting this to work on my dev site, but no luck as of yet... I'm trying to get a slugified version of my "designer" custom field to preface the slugified product name. I've adapted the code mentioned above as follows:Originally posted by chris.j.rodrig View PostHello,
CustomFields actually can be used when generating URLs with URI management. The use of mvt:do will assist with that. Here is the code I used to insert a customfield when generating product URLs
<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" />
<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'CustomField_Code', g.CustomField_Code )" />
/product/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower( l.settings:product:slugified_page_title $ '-' $ g.CustomField_Code)" /><mvt:else><mvt:eval expr="tolower( l.settings:product:slugified_name $ '-' $ g.CustomField_Code )" /></mvt:if>.html
You can place this directly (without line breaks or spaces) into the URI template text field in URI Management. Replace 'CustomField_Code' with your custom field.
I also tried using the original code exactly as provided in the above post (but with my own custom field code replacing the 'CustomField_Code') but no luck with that either.Code:[FONT=Helvetica]<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" />[/FONT] [FONT=Helvetica]<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,’'designer', g.designer )" />[/FONT] [FONT=Helvetica]/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower( l.settings:product:slugified_page_title)" /><mvt:else><mvt:eval expr="tolower([FONT=Helvetica]g.designer [FONT=Helvetica]$ '-' $[/FONT][/FONT] l.settings:product:slugified_name)" /></mvt:if>.html[/FONT]
I'm sort of taking stabs in the dark as I'm not really familiar with the syntax.. just trying to follow the directions that Chris provided above and hopefully get it working through trial and error. Has anyone else tried or succeeded with using slugified custom fields in their URI templates?Last edited by delcorsets; 05-12-18, 04:32 AM.Psydde Delicious
Delicious Boutique & Corseterie
Philadelphia, PA
www.DeliciousBoutique.com
www.DeliciousCorsets.com
Comment
-
It's an old post, I know, but I need to do the same thing.Originally posted by delcorsets View Post
I've tried getting this to work on my dev site, but no luck as of yet... I'm trying to get a slugified version of my "designer" custom field to preface the slugified product name. I've adapted the code mentioned above as follows:
I also tried using the original code exactly as provided in the above post (but with my own custom field code replacing the 'CustomField_Code') but no luck with that either.Code:[FONT=Helvetica]<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" />[/FONT] [FONT=Helvetica]<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,’'designer', g.designer )" />[/FONT] [FONT=Helvetica]/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower( l.settings:product:slugified_page_title)" /><mvt:else><mvt:eval expr="tolower([FONT=Helvetica]g.designer [FONT=Helvetica]$ '-' $[/FONT][/FONT] l.settings:product:slugified_name)" /></mvt:if>.html[/FONT]
I'm sort of taking stabs in the dark as I'm not really familiar with the syntax.. just trying to follow the directions that Chris provided above and hopefully get it working through trial and error. Has anyone else tried or succeeded with using slugified custom fields in their URI templates?
The old MMUI store used this syntax for it's Product Links from the CTGY Page
So has anyone got this to work?Code:<mvt:item name="customfields" param="Read_Product_Code(l.settings:product:code,'url_product_name', g.customProductName)" /> https://&mvte:global:domain:name;/p/&mvt:global:customProductName;/&mvta:product:code;.html
Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: X | Facebook | Pinterest
Comment
-
When I used this code, I got the Page Title in the link but no custom field at all. Closer inspection of the code it is telling it to add the slugified page title. I don't want the slugified page title, I want the Custom Field.Originally posted by chris.j.rodrig View PostHello,
CustomFields actually can be used when generating URLs with URI management. The use of mvt:do will assist with that. Here is the code I used to insert a customfield when generating product URLs
<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" />
<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'CustomField_Code', g.CustomField_Code )" />
/product/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower( l.settings:product:slugified_page_title $ '-' $ g.CustomField_Code)" /><mvt:else><mvt:eval expr="tolower( l.settings:product:slugified_name $ '-' $ g.CustomField_Code )" /></mvt:if>.html
You can place this directly (without line breaks or spaces) into the URI template text field in URI Management. Replace 'CustomField_Code' with your custom field.Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: X | Facebook | Pinterest
Comment
-
Not positive but:
<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'CustomField_Code', g.CustomField_Code )" />
doesn't look right. should be
<mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.settings:product:code,' CustomField_Code', g.CustomField_Code )" />
and just change
l.settings:product:slugified_page_title
to
g.Custom_FieldCode
(though I'd change that variable in all places to something more specific like "g.custom:manufacture_name"
Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
Here is what I tried:
What I got wasCode:<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('url_product_name', l.module )" /><mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.settings:product:code,'url_product_name', g.customProductName )" />/p/<mvt:if expr="NOT ISNULL l.settings:product:slugified_page_title"><mvt:eval expr="tolower(g.customProductName)" /><mvt:else><mvt:eval expr="tolower(g.customProductName)" /></mvt:if>/&mvt:product:code;.html
/p//product_code.html
The custom field was not generated. Hopefully, I just did something wrong with the code.Leslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: X | Facebook | Pinterest
Comment
-
I don't think you need to look up the module info as this is a managed template (given that SMT code can be used). So, try this?
Code:<mvt:item name="customfields" param="Read_Product_Code( g.product_code, 'custom_field_code', l.settings:custom:urlName)" /> /p/<mvt:if expr="NOT ISNULL(l.settings:custom:urlName)"><mvt:eval expr="tolower(l.settings:custom:urlName)" /><mvt:else><mvt:eval expr="tolower(l.settings:product:slugified_page_title)" /></mvt:if>/&mvt:product:code;.html
Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
Thanks, I tried thisOriginally posted by Bruce - PhosphorMedia View PostI don't think you need to look up the module info as this is a managed template (given that SMT code can be used). So, try this?
Code:<mvt:item name="customfields" param="Read_Product_Code( g.product_code, 'custom_field_code', l.settings:custom:urlName)" /> /p/<mvt:if expr="NOT ISNULL(l.settings:custom:urlName)"><mvt:eval expr="tolower(l.settings:custom:urlName)" /><mvt:else><mvt:eval expr="tolower(l.settings:product:slugified_page_title)" /></mvt:if>/&mvt:product:code;.html
but I get this error message:Code:<mvt:item name="customfields" param="Read_Product_Code( g.product_code, 'url_product_name', l.settings:custom:urlName)" /> /p/<mvt:if expr="NOT ISNULL(l.settings:custom:urlName)"><mvt:eval expr="tolower(l.settings:custom:urlName)" /><mvt:else><mvt:eval expr="tolower(l.settings:product:slugified_page_title)" /></mvt:if>/&mvt:product:code;.html
Error compiling template: customfields is not in the list of valid itemsLeslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: X | Facebook | Pinterest
Comment
-
damn, that's why you need the module call...forgot that URI management is not attached to a page:
try
Code:<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" /> <mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'url_product_name', l.settings:custom:urlName )" /> /p/<mvt:if expr="NOT ISNULL(l.settings:custom:urlName)"><mvt:eval expr="tolower(l.settings:custom:urlName)" /><mvt:else><mvt:eval expr="tolower(l.settings:product:slugified_page_title)" /></mvt:if>/&mvt:product:code;.htmlBruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
-
THANK YOU, Bruce! That's what was needed. This needs to be one of those snippets that get put someplace easy to find!Originally posted by Bruce - PhosphorMedia View Postdamn, that's why you need the module call...forgot that URI management is not attached to a page:
try
Code:<mvt:do name="l.module_loaded" file="g.Module_Library_DB" value="Module_Load_Code('customfields', l.module )" /> <mvt:do name="l.result" file="g.Module_Root $ l.module:module" value="Read_Product_Code(l.module, l.param, l.settings:product:code,'url_product_name', l.settings:custom:urlName )" /> /p/<mvt:if expr="NOT ISNULL(l.settings:custom:urlName)"><mvt:eval expr="tolower(l.settings:custom:urlName)" /><mvt:else><mvt:eval expr="tolower(l.settings:product:slugified_page_title)" /></mvt:if>/&mvt:product:code;.htmlLeslie Kirk
Miva Certified Developer
Miva Merchant Specialist since 1997
Previously of Webs Your Way (aka Leslie Nord leslienord)
Email me: [email protected]
www.lesliekirk.com
Follow me: X | Facebook | Pinterest
Comment
-
Google:
"miva merchant" "forums" using custom field in URI management
it's how i roll.Bruce Golub
Phosphor Media - "Your Success is our Business"
Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
phosphormedia.com
Comment
Comment