How to load the following sulu snippet in the twig.html file - twig

I have created the following social media snippet with sulu (headless cms) and now I want to use it in my twig.html file. The only problem is that I don't understand which variables I use to get it running. I have tried a variety of different ways but I just don't understand what variables I need to use so that I can link the social media links correctly. Thanks in advance for the help.
I use sulu as headless cms, and symfony/twig to render it.
This is the Sulu code I have:
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">
<key>socialmedia</key>
<meta>
<title lang="en">Social Media</title>
<title lang="de">Social Media</title>
</meta>
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>
<tag name="sulu.node.name"/>
</property>
<property name="facebookImage" colspan="3" type="single_media_selection">
<meta>
<title lang="en">Facebook Icon</title>
<title lang="de">Facebook Icon</title>
</meta>
</property>
<property name="facebookLink" colspan="9" type="url">
<meta>
<title lang="en">Facebook Link</title>
<title lang="de">Facebook Link</title>
</meta>
<params>
<param name="schemes" type="collection">
<param name="http://"/>
<param name="https://"/>
</param>
</params>
</property>
<property name="instagramImage" colspan="3" type="single_media_selection">
<meta>
<title lang="en">Instagram Icon</title>
<title lang="de">Instagram Icon</title>
</meta>
</property>
<property name="instagramLink" colspan="9" type="url">
<meta>
<title lang="en">Instagram Link</title>
<title lang="de">Instagram Link</title>
</meta>
<params>
<param name="schemes" type="collection">
<param name="http://"/>
<param name="https://"/>
</param>
</params>
</property>
<property name="googleImage" colspan="3" type="single_media_selection">
<meta>
<title lang="en">Google Icon</title>
<title lang="de">Google Icon</title>
</meta>
</property>
<property name="googleLink" colspan="9" type="url">
<meta>
<title lang="en">Google Link</title>
<title lang="de">Google Link</title>
</meta>
<params>
<param name="schemes" type="collection">
<param name="http://"/>
<param name="https://"/>
</param>
</params>
</property>
</properties>

So you can create in your page a snippet_selection or single_snippet_selection to embed a snippet into your page.
If you want to create a snippet which is "global". You can create a snippet area / default snippet.
This means you add a area to your snippet:
<areas>
<area key="settings">
<meta>
<title lang="en">Settings</title>
</meta>
</area>
</areas>
Then you go into the Sulu Admin and create a new snippet. After that you go to your Webspace and select unter "Default Snippets" under the point "Settings" the new snippet.
In your twig you can then load that snippet via the sulu_snippet_load_by_area.html twig function:
{% set snippet = sulu_snippet_load_by_area('settings') %}
{% if snippet %} {# if null content manager did not choice a default snippet in "Default Snippets" Tabs on Webspace #}
{{ dump(snippet) }} {# dump all properties #}
{% endif %}
PS: Try not to create a default/global snippet for every little things. Mostly it is for the "Content Manager" more usable to create 1 "Settings" snippet. Which you have a Section "Social Links" in it instead of having different default snippets.

Related

how to update the names inside the tags of xml using beautiful soup and python

I am tring to change the value of the name inside parent tag whenever there are Z- in the last of the name. by taking the value from my table , let say there are only three such pattern where name ends with Z- and I have values to update in list val.
how can I do that?
lets say this is my XML,
<parent name="A-6/Z-9/B-64/Z-12">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
<parent name="A1/Zh/B/C-12">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
<parent name="AS-5/ZD-9/B-67/Z-13">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
<parent name="An4/Zd-8/B-5/C-13">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
<parent name="A-76/Z-8/B-56/Z-14">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
<parent name="A-45/Z-ty/B-9/C-14">
<item>
<list>
<p name="A">
<p name ="B">
</list>
</item>
</parent>
this is my values in list val = ["Z-99","Z-98","Z-97"]
I want to fix these values in my XML as whenever parent have name ends with Z for example
these
<parent name="A-6/Z-9/B-64/Z-12">
<parent name="AS-5/ZD-9/B-67/Z-13">
<parent name="A-76/Z-8/B-56/Z-14">
I want this
<parent name="A-6/Z-9/B-64/Z-99">
<parent name="AS-5/ZD-9/B-67/Z-98">
<parent name="A-76/Z-8/B-56/Z-97">
I tried these but nothing is working for me
pattern = re.compile(r'[A-Z]+-+[0-9]+/+Z+-+[0-9]$')
for i in soup.find_all('parent', distName=pattern):
for j in val:
i.string = i.string[:-2]+str(j)
for i, val in zip(soup.select('parent > name^="Z-"')
i.string = i.string[:-2]+str(val)
You can try this script to change all required name= attributes from <parent> tag:
from bs4 import BeautifulSoup
txt = '''<parent name="A-6/Z-9/B-64/Z-12">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>
<parent name="A1/Zh/B/C-12">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>
<parent name="AS-5/ZD-9/B-67/Z-13">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>
<parent name="An4/Zd-8/B-5/C-13">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>
<parent name="A-76/Z-8/B-56/Z-14">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>
<parent name="A-45/Z-ty/B-9/C-14">
<item>
<list>
<p name="A"></p>
<p name="B"></p>
</list>
</item>
</parent>'''
soup = BeautifulSoup(txt, 'html.parser')
values = ["Z-99","Z-98","Z-97"]
r = re.compile(r'Z-\d+$')
for parent, new_val in zip(soup.find_all('parent', {'name': r}), values):
parent['name'] = r.sub(new_val, parent['name'])
print(soup.prettify())
Prints:
<parent name="A-6/Z-9/B-64/Z-99">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>
<parent name="A1/Zh/B/C-12">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>
<parent name="AS-5/ZD-9/B-67/Z-98">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>
<parent name="An4/Zd-8/B-5/C-13">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>
<parent name="A-76/Z-8/B-56/Z-97">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>
<parent name="A-45/Z-ty/B-9/C-14">
<item>
<list>
<p name="A">
</p>
<p name="B">
</p>
</list>
</item>
</parent>

Register event listener when office addin (Excel) is initialized

I would like register event listener let say listener for event when worksheet changed. But listener should be automatically registered when to office addin is initialized.
I have known that with open of the taskpane you can register the listener but this is not my case. Actually what I tried to do is registered event listener when the function file is loaded and not sure if this is correct way.
I would appreciate any suggestions how can be reached this solution if can be possible.
Here is example of function file.
Html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.debug.js"></script>
<script type="text/javascript" src="../function-file.js"></script>
</head>
<body>
<!-- NOTE: The body is empty on purpose. Since function in function-file.js are
invoked via a button, there is no UI to render. -->
</body>
</html>
Typescript file
(() => {
// The initialize function must be run each time a new page is loaded
Office.initialize = () => {
$(document).ready(function () {
registerWorksheetChangedHandler()
/* the rest of your code here */
})
};
// Add any ui-less function here
})();
//Worksheet changed cell events
function registerWorksheetChangedHandler() {
Excel.run(function (context) {
var worksheet = context.workbook.worksheets.getActiveWorksheet()
worksheet.onChanged.add(handleWorksheetChanged);
return context.sync()
.then(function () {
console.log("Event handler successfully registered for onWorksheetChanged event in the worksheet.");
});
}).catch(error => console.log("Error: " + error));
}
function handleWorksheetChanged(event)
{
return Excel.run(function(context){
return context.sync()
.then(function() {
console.log("Change type of event: " + event.changeType);
console.log("Address of event: " + event.address);
console.log("Source of event: " + event.source);
}).catch(error => console.log("Error: " + error));
})
}
Manifest
<?xml version="1.0" encoding="UTF-8"?>
<OfficeApp
xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides"
xsi:type="TaskPaneApp">
<!-- Begin Basic Settings: Add-in metadata, used for all versions of Office unless override provided. -->
<!-- IMPORTANT! Id must be unique for your add-in, if you reuse this manifest ensure that you change this id to a new GUID. -->
<Id>edcf304e-2101-4a0f-8306-7b34608f886a</Id>
<!--Version. Updates from the store only get triggered if there is a version change. -->
<Version>1.0.0.0</Version>
<ProviderName>CSSoft a.s.</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<!-- The display name of your add-in. Used on the store and various places of the Office UI such as the add-ins dialog. -->
<DisplayName DefaultValue="CSSoft Office Addin" />
<Description DefaultValue="CSSoft Office Addin"/>
<!-- Icon for your add-in. Used on installation screens and the add-ins dialog. -->
<IconUrl DefaultValue="https://localhost:3000/assets/icon-32.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/icon-80.png"/>
<!--If you plan to submit this add-in to the Office Store, uncomment the SupportUrl element below-->
<!--<SupportUrl DefaultValue="[Insert the URL of a page that provides support information for the app]">-->
<!-- Domains that will be allowed when navigating. For example, if you use ShowTaskpane and then have an href link, navigation will only be allowed if the domain is on this list. -->
<AppDomains>
<AppDomain>AppDomain1</AppDomain>
<AppDomain>AppDomain2</AppDomain>
<AppDomain>AppDomain3</AppDomain>
</AppDomains>
<!--End Basic Settings. -->
<!--Begin TaskPane Mode integration. This section is used if there are no VersionOverrides or if the Office client version does not support add-in commands. -->
<Hosts>
<Host Name="Workbook" />
</Hosts>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3000/index.html" />
</DefaultSettings>
<!-- End TaskPane Mode integration. -->
<Permissions>ReadWriteDocument</Permissions>
<!-- Begin Add-in Commands Mode integration. -->
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<!-- The Hosts node is required. -->
<Hosts>
<!-- Each host can have a different set of commands. -->
<!-- Excel host is Workbook, Word host is Document, and PowerPoint host is Presentation. -->
<!-- Make sure the hosts you override match the hosts declared in the top section of the manifest. -->
<Host xsi:type="Workbook">
<!-- Form factor. Currently only DesktopFormFactor is supported. -->
<DesktopFormFactor>
<!--"This code enables a customizable message to be displayed when the add-in is loaded successfully upon individual install."-->
<GetStarted>
<!-- Title of the Getting Started callout. resid points to a ShortString resource -->
<Title resid="CSSoft.GetStarted.Title"/>
<!-- Description of the Getting Started callout. resid points to a LongString resource -->
<Description resid="CSSoft.GetStarted.Description"/>
<!-- Point to a url resource which details how the add-in should be used. -->
<LearnMoreUrl resid="CSSoft.GetStarted.LearnMoreUrl"/>
</GetStarted>
<!-- Function file is a HTML page that includes the JavaScript where functions for ExecuteAction will be called.
Think of the FunctionFile as the code behind ExecuteFunction. -->
<FunctionFile resid="CSSoft.DesktopFunctionFile.Url" />
<!-- PrimaryCommandSurface is the main Office Ribbon. -->
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<!-- Use OfficeTab to extend an existing Tab. Use CustomTab to create a new tab. -->
<!-- <OfficeTab id="TabHome"> -->
<CustomTab id="CSSoft.CustomTab">
<!-- Ensure you provide a unique id for the group. Recommendation for any IDs is to namespace using your company name. -->
<Group id="CSSoft.Group">
<!-- Label for your group. resid must point to a ShortString resource. -->
<Label resid="CSSoft.GroupLabel" />
<!-- Icons. Required sizes 16,32,80, optional 20, 24, 40, 48, 64. Strongly recommended to provide all sizes for great UX. -->
<!-- Use PNG icons. All URLs on the resources section must use HTTPS. -->
<Icon>
<bt:Image size="16" resid="CSSoft.tpicon_16x16" />
<bt:Image size="32" resid="CSSoft.tpicon_32x32" />
<bt:Image size="80" resid="CSSoft.tpicon_80x80" />
</Icon>
<!-- Menu example -->
<Control xsi:type="Button" id="CSSoft.Menu">
<Label resid="CSSoft.Menu.Label" />
<Tooltip resid="CSSoft.Menu.Tooltip" />
<Supertip>
<Title resid="CSSoft.Menu.Label" />
<Description resid="CSSoft.Menu.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="CSSoft.menu_16x16" />
<bt:Image size="32" resid="CSSoft.menu_32x32" />
<bt:Image size="80" resid="CSSoft.menu_80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>CSSoftMenuTaskPaneID</TaskpaneId>
<SourceLocation resid="CSSoft.Taskpane.Url" />
</Action>
</Control>
</Group>
<!--</OfficeTab>-->
<Label resid="CSSoft.CustomTab.Label" />
</CustomTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<!-- You can use resources across hosts and form factors. -->
<Resources>
<bt:Images>
<bt:Image id="CSSoft.tpicon_16x16" DefaultValue="https://localhost:3000/assets/icon-16.png" />
<bt:Image id="CSSoft.tpicon_32x32" DefaultValue="https://localhost:3000/assets/icon-32.png" />
<bt:Image id="CSSoft.tpicon_80x80" DefaultValue="https://localhost:3000/assets/icon-80.png" />
<bt:Image id="CSSoft.menu_16x16" DefaultValue="https://localhost:3000/assets/menu_16x16.png" />
<bt:Image id="CSSoft.menu_32x32" DefaultValue="https://localhost:3000/assets/menu_32x32.png" />
<bt:Image id="CSSoft.menu_80x80" DefaultValue="https://localhost:3000/assets/menu_80x80.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="CSSoft.Taskpane.Url" DefaultValue="https://localhost:3000/index.html" />
<bt:Url id="CSSoft.GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
<bt:Url id="CSSoft.DesktopFunctionFile.Url" DefaultValue="https://localhost:3000/function-file/function-file.html" />
</bt:Urls>
<!-- ShortStrings max characters==125. -->
<bt:ShortStrings>
<bt:String id="CSSoft.TaskpaneButton.Label" DefaultValue="Show Taskpane" />
<bt:String id="CSSoft.GroupLabel" DefaultValue="Menu" />
<bt:String id="CSSoft.GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
<bt:String id="CSSoft.CustomTab.Label" DefaultValue="CSSoft"/>
<bt:String id="CSSoft.Menu.Label" DefaultValue="Go Menu"/>
</bt:ShortStrings>
<!-- LongStrings max characters==250. -->
<bt:LongStrings>
<bt:String id="CSSoft.TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
<bt:String id="CSSoft.GetStarted.Description" DefaultValue="CSSoft add-in loaded succesfully. Go to the CSSoft tab and click the 'Go Menu' button to get started." />
<bt:String id="CSSoft.Menu.Tooltip" DefaultValue="Access into the main menu" />
</bt:LongStrings>
</Resources>
</VersionOverrides>
<!-- End Add-in Commands Mode integration. -->
</OfficeApp>

Using the SharePoint REST API to update a list item

I am attempting to update a list item using the SharePoint REST API but am encountering the following error:
<?xml version="1.0" encoding="utf-8"?>
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-1, Microsoft.SharePoint.Client.InvalidClientQueryException</m:code>
<m:message xml:lang="en-US">The expression "web/lists/GetByTitle('Drop Off Library')/items("http:/example.com/_api/Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')")" is not valid.</m:message>
</m:error>
After adding the file, I receive the following response:
<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="http://example.com/_api/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<id>http://example.com/_api/Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')</id>
<category term="SP.File" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link rel="edit" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Author" type="application/atom+xml;type=entry" title="Author" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/Author" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CheckedOutByUser" type="application/atom+xml;type=entry" title="CheckedOutByUser" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/CheckedOutByUser" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/EffectiveInformationRightsManagementSettings" type="application/atom+xml;type=entry" title="EffectiveInformationRightsManagementSettings" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/EffectiveInformationRightsManagementSettings" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/InformationRightsManagementSettings" type="application/atom+xml;type=entry" title="InformationRightsManagementSettings" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/InformationRightsManagementSettings" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ListItemAllFields" type="application/atom+xml;type=entry" title="ListItemAllFields" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/ListItemAllFields" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/LockedByUser" type="application/atom+xml;type=entry" title="LockedByUser" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/LockedByUser" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/ModifiedBy" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Properties" type="application/atom+xml;type=entry" title="Properties" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/Properties" />
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Versions" type="application/atom+xml;type=feed" title="Versions" href="Web/GetFileByServerRelativeUrl('/DropOffLibrary/b.txt')/Versions" />
<title />
<updated>2019-01-11T14:47:13Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:CheckInComment></d:CheckInComment>
<d:CheckOutType m:type="Edm.Int32">0</d:CheckOutType>
<d:ContentTag>{2BDD4E2D-79C8-4F6B-8DD7-AC745D9360A8},1,1</d:ContentTag>
<d:CustomizedPageStatus m:type="Edm.Int32">0</d:CustomizedPageStatus>
<d:ETag>"{2BDD4E2D-79C8-4F6B-8DD7-AC745D9360A8},1"</d:ETag>
<d:Exists m:type="Edm.Boolean">true</d:Exists>
<d:IrmEnabled m:type="Edm.Boolean">false</d:IrmEnabled>
<d:Length m:type="Edm.Int64">4</d:Length>
<d:Level m:type="Edm.Byte">255</d:Level>
<d:LinkingUrl></d:LinkingUrl>
<d:MajorVersion m:type="Edm.Int32">1</d:MajorVersion>
<d:MinorVersion m:type="Edm.Int32">0</d:MinorVersion>
<d:Name>b.txt</d:Name>
<d:ServerRelativeUrl>/DropOffLibrary/b.txt</d:ServerRelativeUrl>
<d:TimeCreated m:type="Edm.DateTime">2019-01-11T14:47:13Z</d:TimeCreated>
<d:TimeLastModified m:type="Edm.DateTime">2019-01-11T14:47:13Z</d:TimeLastModified>
<d:Title m:null="true" />
<d:UIVersion m:type="Edm.Int32">512</d:UIVersion>
<d:UIVersionLabel>1.0</d:UIVersionLabel>
<d:UniqueId m:type="Edm.Guid">2bdd4e2d-79c8-4f6b-8dd7-ac745d9360a8</d:UniqueId>
</m:properties>
</content>
</entry>
My assumption here is that the item id is either the value of the <id> tag or the value of the <UniqueId> tag, but neither have worked.
First you should set Accept header to application/json for your request so the result will be a bit better to read.
Item ID is an incremental integer in the library. You can add column ID to a view in the library to see the value for each file. From some reason this ID is missing in the response you get when the file is uploaded.
To get item by ID (best option) use:
/_api/web/lists/getByTitle('Drop Off Library')/items(1)
To get item by server relative url (also fine option) use:
/_api/web/getFileByServerRelativeUrl('/DropOffLibrary/b.txt')
UniqueId is a guid which cannot be easily used for querying the item. You would have to use $filter parameter, but it is not optimal due to performace impact.
/_api/web/lists/getByTitle('Drop Off Library')/items?$filter=GUID eq guid'2bdd4e2d-79c8-4f6b-8dd7-ac745d9360a8'

Alfresco custom data list layout

I have created a custom data list in Alfresco, and have populated its model with the desired data columns. However, when I view the list in Alfresco share, the order is completely off, and there are elements that I have not defined in the model.
I have searched extensively as to how to fix this, and have not been successful. From what I understand, I need to define the layout in the share-config-custom.xml, which I have attempted below (snippet of only what I added):
<config evaluator="model-type" condition="orpdl:orpList">
<forms>
<form>
<field-visibility>
<show id="orpdl:programName" />
</field-visibility>
<create-form template="../data-lists/forms/dataitem.ftl" />
<appearance>
<field id="orpdl:programName">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
<config evaluator="node-type" condition="orpdl:orpList">
<forms>
<form>
<field-visibility>
<show id="orpdl:programName" />
</field-visibility>
<create-form template="../data-lists/forms/dataitem.ftl" />
<appearance>
<field id="orpdl:programName">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
Content model:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="orpdl:orpDataListModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!-- Optional meta-data about the model -->
<description>Information retrieved from the Opportunity Registration Process workflow form.</description>
<author>Alan George</author>
<version>1.0</version>
<!-- Imports are required to allow references to definitions in other models -->
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
</imports>
<!-- Introduction of new namespaces defined by this model -->
<namespaces>
<namespace uri="http://www.test.com/model/orpDataListModel/1.0" prefix="orpdl" />
</namespaces>
<constraints>
<constraint name="orpdl:contractTypeList" type="LIST">
<parameter name="allowedValues">
<list>
<value>T&M</value>
<value>FFP</value>
<value>CPFF</value>
<value>CPIF</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<type name="orpdl:orpList">
<title>Opportunity Registration Process</title>
<description>Information retrieved from the Opportunity Registration Process workflow form.</description>
<parent>dl:dataListItem</parent>
<properties>
<property name="orpdl:programName">
<title>Program Name</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="orpdl:programDescription">
<title>Program Description</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="orpdl:client">
<title>Client</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="orpdl:contractType">
<title>Contract Type</title>
<type>d:text</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="orpdl:contractTypeList" />
</constraints>
</property>
<property name="orpdl:value">
<title>Value</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</type>
</types>
</model>
The goal of this code is to have only the programName text box appear. But this is what I'm seeing:
What am I missing?
You are entering wrong condition in <config> tag.
Below
<config evaluator="model-type" condition="orpdl:orpDataListModel">
should replace with
<config evaluator="model-type" condition="orpdl:issuesList">
This will also apply to node-type.

MovableType: Is it possible to have a rss feed for "todays" entries?

Background
Our email vendor supports rss feeds for dynamic content, which we use successfully for "daily headline" type emails. This is a great help in automating many different emails that we don't have staffing to create daily. One of our staff as requested that his daily email (which has recent headlines from his Movable Type blog) only have headlines from entries posted on that day.
My Question
Since we use Movable Type for his blog, is there a way to generate a rss feed that only contains items posted on the current day?
Your solution can be simplified by using the "days" parameter on mt:Entries:
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><$MTBlogName remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTBlogURL encode_xml="1"$>" />
<link rel="self" type="application/atom+xml" href="<$MTBlogURL$>atom.xml" />
<id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<$MTDate format="%Y"$>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id>
<link rel="service.post" type="application/atom+xml" href="<$MTCGIPath$><$MTAtomScript$>/weblog/blog_id=<$MTBlogID$>" title="<$MTBlogName encode_html="1"$>" />
<updated><MTEntries lastn="1"><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></MTEntries></updated>
<MTIfNonEmpty tag="MTBlogDescription"><subtitle><$MTBlogDescription remove_html="1" encode_xml="1"$></subtitle></MTIfNonEmpty>
<generator uri="http://www.sixapart.com/movabletype/">Movable Type <$MTVersion$></generator>
<MTEntries days="1">
<entry>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTEntryPermalink encode_xml="1"$>" />
<link rel="service.edit" type="application/atom+xml" href="<$MTCGIPath$><$MTAtomScript$>/weblog/blog_id=<$MTBlogID$>/entry_id=<$MTEntryID$>" title="<$MTEntryTitle encode_html="1"$>" />
<id><$MTEntryAtomID$></id>
<published><$MTEntryDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></published>
<updated><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></updated>
<summary><$MTEntryExcerpt remove_html="1" encode_xml="1"$></summary>
<author>
<name><$MTEntryAuthorDisplayName encode_xml="1"$></name>
<MTIfNonEmpty tag="MTEntryAuthorURL"><uri><$MTEntryAuthorURL encode_xml="1"$></uri></MTIfNonEmpty>
</author>
<MTEntryCategories>
<category term="<$MTCategoryLabel encode_xml="1"$>" />
</MTEntryCategories>
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<$MTEntryBody encode_xml="1"$>
<$MTEntryMore encode_xml="1"$>
</content>
</entry>
</MTEntries>
No need for checking the date yourself, this also removes the empty "entry" tags your version creates.
Okay, so i figured it out myself.
First I had to create a new feed, which i named "daily.xml" and copied the default code from atom.xml into it. Then I used setvarblock to define variables for the current date and publish date. Once this was done I used if to compare the 2 variables, and show the ones that matched.
code:
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><$MTBlogName remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTBlogURL encode_xml="1"$>" />
<link rel="self" type="application/atom+xml" href="<$MTBlogURL$>atom.xml" />
<id>tag:<$MTBlogHost exclude_port="1" encode_xml="1"$>,<$MTDate format="%Y"$>:<$MTBlogRelativeURL encode_xml="1"$>/<$MTBlogID$></id>
<link rel="service.post" type="application/atom+xml" href="<$MTCGIPath$><$MTAtomScript$>/weblog/blog_id=<$MTBlogID$>" title="<$MTBlogName encode_html="1"$>" />
<updated><MTEntries lastn="1"><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></MTEntries></updated>
<MTIfNonEmpty tag="MTBlogDescription"><subtitle><$MTBlogDescription remove_html="1" encode_xml="1"$></subtitle></MTIfNonEmpty>
<generator uri="http://www.sixapart.com/movabletype/">Movable Type <$MTVersion$></generator>
<MTEntries lastn="15">
<entry>
<!-- this sets the current date to a variable named "TodaysDate" -->
<mt:setvarblock name="TodayDate"><$mt:Date format="%Y%m%d"></mt:setvarblock>
<!-- this sets the entry publish date to a variable named "PublishedDate" -->
<mt:setvarblock name="PublishedDate"><$mt:EntryDate format="%Y%m%d"></mt:setvarblock>
<!-- starts an IF statement comparing equality of "PublishedDate" and "TodayDate". note: for some reason the second variable needs to have an '$' added to the front -->
<mt:if name="PublishedDate" eq="$TodayDate">
<!-- the rest of this (except the end of the IF statement) is copied from default template -->
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link rel="alternate" type="text/html" href="<$MTEntryPermalink encode_xml="1"$>" />
<link rel="service.edit" type="application/atom+xml" href="<$MTCGIPath$><$MTAtomScript$>/weblog/blog_id=<$MTBlogID$>/entry_id=<$MTEntryID$>" title="<$MTEntryTitle encode_html="1"$>" />
<id><$MTEntryAtomID$></id>
<published><$MTEntryDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></published>
<updated><$MTEntryModifiedDate utc="1" format="%Y-%m-%dT%H:%M:%SZ"$></updated>
<summary><$MTEntryExcerpt remove_html="1" encode_xml="1"$></summary>
<author>
<name><$MTEntryAuthorDisplayName encode_xml="1"$></name>
<MTIfNonEmpty tag="MTEntryAuthorURL"><uri><$MTEntryAuthorURL encode_xml="1"$></uri></MTIfNonEmpty>
</author>
<MTEntryCategories>
<category term="<$MTCategoryLabel encode_xml="1"$>" />
</MTEntryCategories>
<content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>">
<$MTEntryBody encode_xml="1"$>
<$MTEntryMore encode_xml="1"$>
</content>
<!-- end of our IF statement -->
</mt:if>
</entry>
</MTEntries>
</feed>

Resources