Specifying Meta Fields per template - metadata

Is it possible to specify metafields in theme? I'm thinking either in a header part of the liquid template file or in the settings_data.json file or somewhere?
That would enable us to have different meta fields for different page tempaltes and to specify that information in code where it is under source control.
To be clear, I'm not asking how to access the metafield data once it's set. Thats well documented and straight forward. I'm asking how to define in the theme what metafield keys should have form fields in the corresponding edit screens in /admin.
So, if for example I have a template /page.coffee.liquid there might be a header section:
````
/page.coffee.liquid
----------------------------------
Fields:
extras
Origin: String
Strength: integer
Options: radio
Milk
Sugar
----------------------------------
<h1>Hi, checkout your coffee</h1>
<ul>
<li>Origin: {{ extras.Origin }}</li>
<li>Strength: {{ extras.Strength }}</li>
<li>Milk n Sugar: {{ extras.Options }}</li>
</ul>
````
Shpify would then now that if a product uses this template (selected in the admin interface) then these metafield options would show in the edit screen in admin.
This is an example of how it could work to enable me to do what i want, which is:
Define metafield controls displayed in the admin area per template within a config or template file.

Shopify doesn't work that way. You'd do this with an app where you would link the template and sets of metafields.
The app would use the embedded app sdk so that it can be embedded in the Shopify admin
The app would provide an admin link on the product page. Your app would check the product template and look up the metafields needed and then present those with appropriate drop-downs/validation etc.

Biggest and most incredible thing I have found to help with metafields is this Chrome Extension by FreakDesign called ShopifyFD.
It's a Chrome extension that -- once clicked and activated -- extends your Shopify admin pages to give you complete access to current metafields as well as any new ones that you want to add.
I just found it the other day and I got so giddy with the new doors that opened up.
This will allow you to control your metafields per page and then handle your logic elsewhere.
Source: https://freakdesign.com.au/pages/shopifyfd

Related

TYPO3: tx_news modify news forms

I'm working on a magazine page. Therefor I would like the client to be able to select the design type when creating/editing a new post. So I'd like to add a custom field to the "edit news", something like a dropdown where all the news (design) types are listed.
For example: News Types:
Normal
Interview
Date
Special Event
etc...
When the client doesn't select anything it should fallback to a default i.e "Normal" and also it would be nice that when the client selects Interview a second input field shows up where he can enter the persons profession/description.
My goal is, that in the fluid template I can add a line where the selected news type will be added as a class to the list item, something like:
<div class="news-item {newsItem.type}">
// some code
</div>
will render out as:
<div class="news-item interview">
// some code
<div>
I'm not quite sure what I have to add to my custom extension that I'm using to accomplish that.
I appreciate all the help.
you need to extend the news data with further fields. This is described in the manual and this blog(ext:news is extended, but filestructure is old) and this article(current fielstructure, but other tabel is enhanced).
For the evaluation and displaying of your fields you need to modify the templates of ext:news. copy the neccessary parts into your extension and provide the modifications to it.
Also set the typoscript to include your templates like described in the manual.

Sitecore Set base templates excluding a Field

Is there a way in sitecore where , when you are setting a base template you can exclude a certain field ?
For eg: i have a base template with 4 fields
Name,Id, Salary, Phone number , Facebook Id, Twitter Id, LinkedID
If i have 3 Item Templates FB, Twitter, Lin which has the same Base template -
I would like not to inherit only certain fields - ie, for FB Item I would like to inherit everything except Linkedin and Twitter . And for twitter - everything except FB and Lin.
Please note: this is just an example scenario. This is the best example i could think of. I would like to know if this is feasible with sitecore.
I understand that the ideal option would be to separate out the user info template from social info. But that is just for this scenario.
No. You cannot do this in Sitecore.
Sitecore template inheritance does not allow excluding certain fields from inheriting in child templates.
You may consider creating another "base base template" containing only what's needed in all inheriting templates.

What portions of the marketo code snippet can change?

My company is using marketo forms, and we are generating the page from a content management system.
We'd like to keep the contribution experience as simple as possible and prevent the user from contributing actual <script> tags.
The API documentation says they will give you a block of code that looks like this:
<script src="//app-sjqe.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_621"></form>
<script>MktoForms2.loadForm("//app-sjqe.marketo.com", "718-GIV-198", 621);</script>
My question is, what portions of this code are subject to change?
I am sure the 3 part hypen separated string and the integer being passed in can change.
What about the app-sjqe.marketo.com address?
The 3-part string is your Marketo instance ID, and shouldn't really change. The other integer is the form ID, which definitely will change depending on what form you want to embed.
The other thing that you may want to consider, is the other configurable options that you can send along with the form embed. For example, in the module that I have made for my CMS, I let the user put an optional 'thank-you' page URL, to redirect the form to after submission, and also a checkbox to optionally open the form in a lightbox on page load.
The simple module I made is for the Sitefinity CMS - happy to share code with you if that helps!

How to integrate DTM (Dynamic Tag Management) with AEM 6?

I am a newbie to Adobe DTM (Dynamic Tag Management) and have not done any kind of training related to it. However, I have been given a requirement to integrate DTM with AEM 6. I Have some requirements related to Omniture where certain events on the website are tracked and that information needs to be sent to DTM. I have followed steps described on this blog (http://blogs.adobe.com/aemtutorials/2013/07/24/customize-the-client-context/) to customize the client context by creating a new session store and storing some sample data inside it. Now, next part is to retrieve this data into DTM which I am completely unaware on how to do. What is need to achieve in particular is to create a new data element as shown in the screenshot below and write some custom java script to access the data stored inside the client context (which is present in the session store) as explained in the blog mentioned.
I have no idea on how to integrate DTM with AEM instance and how to get hold of that data needed using the script. There is no info available on the internet regarding this, hence request you to help me in case anybody have worked on such a requirement earlier. Any help is highly appreciated
Step 1 - Set up DTM cloud services configuration in AEM. You may find cloud services config at /etc/cloudservices/dynamictagmanagement.html
Step 2 - Apply the above cloud config to the root of your website using the page property. This will insert the required JS scripts and JS object into the DOM. You could also do step (1) & (2) together by manually inserting header and footer code (from DTM) into the template.
Step 3 - Supply data to DTM JS object. This you could populate the data from server side or at client side using JS. You could leverage client context as well. JS APIs available to query client context.
PS: Am also a learner on this.
Helpful links:
http://blogs.adobe.com/experiencedelivers/experience-management/integrating-dtm-custom-aem6-page-template/
http://docs.adobe.com/docs/en/aem/6-0/administer/integration/marketing-cloud/dtm.html
You can use data elements with custom script like this:
e.g. dataElement authorizableId is custom script with content
return CQ_Analytics.ClientContext.get("/profile/authorizableId");
or
dataElement pageTitle
return CQ_Analytics.PageDataMgr.getProperty("title”);
This is how I implemented it. Please note that this implementation is for integrating with flat HTML files. Where we need to add the scripts in Head tag.
Pre-requisites:
1. We need to have login credentials for DTM website.
We need to have admin rights.
We need sc3.omniture site credentials. This is usually provided by Adobe team.
From Omniture console we need to generate the AppMeasurement.js file.
From AppMeasurement.js file we need to get important details like:
a. Tracking Server Name
b. s_account name
c. Visitor namespace
Connecting HTML files to DTM:
Login to https://dtm.adobe.com with admin credentials.
Click on Project dashboard
Click on Embed tab on top navigation.
Enable Host on Akamai.
Expand Header Code widget and copy the code.
Paste that code in the tag of your HTML.
Go back to DTM again. Expand Footer Code widget and copy the code.
Paste that code to the tag of your HTML.
Configuring DTM for Direct Call Rules:
1. Go to Rules tab from top navigation.
2. Click on Direct Call Rules from left navigation now.
Click on create rule.
Give it a name in the Name section.
Expand Conditions widget.
Pay close attention to the Conditions textbox. Direct Call Rules are fired using the _satelitte.track() method, and the text you enter in the Conditions textbox will be the argument you pass in this method. We entered “change-offer-submit”, so to fire this Direct Call Rule, we will use _satelitte.track(“change-offer-submit”) as you will see in the code below.
Now use the Adobe Analytics section to set up a custom link.
Below is the code that sets up our form and its validation. Notice the way the DTM _satelitte.track() is used. Each of the arguments passed in the _satelitte.track() method matches the Condition textbox in separate DTM rules.
HTML
<div class="outer-btn">
<input class="input-btn analyticsEvent" type="button" value="Submit" data-eventName="change-offer-submit">
</div>
JavaScript
<script>
jQuery('.analyticsEvent').on('click',function() {
window.console.log('Logged Event: ' + jQuery(this).attr('data-eventName'));
_satellite.track(jQuery(this).attr('data-eventName'));
location.href='./landingPage.html';
});
</script>
This has been superseded by a tool added to DTM in the June 2016 release, ContextHub was added in 6.1 as beta, in 6.2 it reached feature parity with ClientContext. It saves a lot of time building data layers as a lot of it will be there already .

1. I fill out a form & click submit. 2. I get the results page. Goal: Get the same results without filling out the form again

This is my first time posting - I greatly appreciate any and all guidance on this subject.
Background: I am building a Real Estate web site. I would like to use the free IDX data provided by my local MLS board. The MLS board does not allow me the option of displaying a predefined search and only provides me with a link to the search field. after filling out the search field, I am able to view the results.
Goal: I would like to bypass this step and frame the results page into a GoDaddy website I am building, which supports HTML.
Here is a link to the search page:
http://fgcmls.rapmls.com/scripts/mgrqispi.dll?APPNAME=Fortmyers&PRGNAME=MLSLogin&ARGUMENT=vBSJvLQtMcbg7F0O0KnXDiggv%2F12B0S6Ss9wv4510QA%3D&KeyRid=1
I am trying to only show the listings that appear in my neighborhood. Options include:
1. Property Type - Residential
2. GEO Area - FM11
3. Developments: Fiddlesticks Country Club
Once this criteria is entered, I have the page needed to make this project work.
Thank all of you for taking the time to read this and for the time you spend helping me out.
Best regards,
Chris
Without looking at the page itself, it's probably doing a "POST" operation to give the form to the website. You should be able to use javascript (maybe jquery or some other ajax framework) to do this for you in the frame and have it display the results.
-Adam
So long as this is a POST form and they aren't doing a lot of strict referrer checking, the following should work:
Replicate the form on your own site.
Make a few minor changes to automate a few of the fields to better serve your geographic area/company.
Ensure everything is a full path and not relative to the server handling the query.
You will probably end up changing a lot of the text/select fields to hidden fields with pre-set values to keep it simple for end-users. The server handling the request won't know the kind of field it came from, just the value and name.
I took a look at the page HTML, the form posts is defined thusly:
<FORM action="/scripts/mgrqispi.dll" method="POST" name="InputForm" />
you may be able to create your own form defined like this:
<FORM action="http://fgcmls.rapmls.com/scripts/mgrqispi.dll" method="POST" name="InputForm">
</FORM>
You will have to go through the HTML on the page you provided to get the appropriate ID's and Name's of the form elements you are interested in. Its possible their processing page checks to ensure its their form that is submitting to it, in which case this wouldn't work.
good luck.