dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
864 stars 467 forks source link

Extract and comment the variables for the AI custom field VTL file #30002

Open fishsmith opened 2 months ago

fishsmith commented 2 months ago

Parent Issue

No response

Task

In the AI custom field example, we should extract the variables and set them in the custom field itself, and add comments. This will make the VTL file reusable for other content types and fields.

This just the idea I had but open to suggestions on what we can set

Example

SET THE FIELD NAME YOU WOULD LIKE TO USE FOR THE PROMT

set( $promptTitleField = "heading" )

set( $promptBodyField = "editor-input-value-challenge )

SET THE PROMT TEXT

set( $promptText = "

Instructions: write a 100-word summary for a web page with this title $esc.quote${$promptTitleField}$esc.quote and this content $esc.quote${$promptBodyField }$esc.quote") Context: This will be used as the SEO meta description to help search engines understand what the page is about. It should use Google best practices. Tone: Write in a clear, unembellished style appropriate for search engine results. ")

SET THE FIELD YOU WOULD LIKE TO WRITE THE RESPONSE TO

set( $metaDescriptionFieldId = "metaDescription" )

VTL FILE FOR CUSTOM FIELD

dotParse("/dA/07e5f8c3a8/fileAsset/ai-text-field.vtl")

Proposed Objective

User Experience

Proposed Priority

Priority 3 - Average

Acceptance Criteria

No response

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

john-thomas-dotcms commented 2 months ago

@victoralfaro-dotcms I believe the original plan for this custom field was to set the variables outside the VTL file. In any case, I think we should be able to do this in GD; please take a look and let me know if you think it will be bigger than that.