One big "Hi" for all humans from planet Tridion :).
I am trying to make component links editable in SDL Tridion UI 2012.
I have one component that contains multi-valued component links as one of fields.
When I put following in DWT
<!-- TemplateBeginRepeat name="componentLink" -->
<!-- TemplateBeginIf cond="TemplateRepeatIndex<3" -->
<li>
<a href="#" tridion:href="##RenderComponentField(FieldPath+"componentLink",TemplateRepeatIndex)##">
Link${TemplateRepeatIndex}
</a>
</li>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
Inside Template Builder as a result I got following:
<li>tcm:8-625</tcdl:ComponentField>">Link0</li>
<li>tcm:8-626</tcdl:ComponentField>">Link1</li>
<li>tcm:8-627</tcdl:ComponentField>">Link2</li>
As expected an error occured on "Default Finish Actions" on a page level
Unable to find proper value for tridion:href
Is it needed to extract component links inside C# TBB in some previous action or exist any other way to resolve this( Enabling component links for SDL Tridion UI)?
In my "new UI VM" I have the following code in a design:
<tcdl:ComponentField name="LinkText">
<a tridion:href="##Component.Fields.Target##">${LinkText}</a>
</tcdl:ComponentField>
The linked Component is editable in the new UI. The tcdl:ComponentField is processed to wrap the appropriate in-context editing instructions around the link. You should be able translate that on to your code pretty easily...
Thank you Jeremy, manually adding <tcdl:ComponentField> tag resolve this issue.
Here is final code that correctly resolve component links on a page level:
<!-- TemplateBeginRepeat name="componentLink" -->
<!-- TemplateBeginIf cond="TemplateRepeatIndex<3" -->
<li>
<tcdl:ComponentField name="componentLink">
<a tridion:href="##Field##">Link${TemplateRepeatIndex} </a>
</tcdl:ComponentField>
</li>
<!-- TemplateEndIf -->
<!-- TemplateEndRepeat -->
Related
I try to use Divider and Card control from the uno.toolkit.ui package:
<utu:Divider SubHeader="Uno.Material Controls:"
Style="{StaticResource MaterialDividerStyle}" />
<utu:Card HeaderContent="Header Outlined card With supporting text"
SubHeaderContent="With supporting text"
SupportingContent="This is the supporting text"
Style="{StaticResource MaterialOutlinedCardStyle}" />
when I run the sample, I get a lot of messages like:
warn: Uno.UI.ResourceResolver[0]
Couldn't statically resolve resource MaterialOutlinedCardContentControlStyle
warn: Uno.UI.ResourceResolver[0]
Couldn't statically resolve resource MaterialDividerStyle
warn: Uno.UI.ResourceResolver[0]
and the Controls are not displayed. Using the TabBar - Control from the Toolkit works.
Any idea what is going wrong?
Make sure to follow instructions as described in the README page on the uno.toolkit.ui repo...
Since the reference to the missing style (MaterialDividerStyle for the <Divider> control) is defined in the MaterialToolkitResources dictionary, you need to add a reference to it in your App.xaml file, like that:
<!-- App.xaml: -->
<!-- Load Uno.UI.Toolkit resources -->
<ToolkitResources xmlns="using:Uno.Toolkit.UI" />
<!-- Load Material resources -->
<MaterialColors xmlns="using:Uno.Material" />
<MaterialResources xmlns="using:Uno.Material" />
<!-- Load Material Toolkit resources -->
<MaterialToolkitResources xmlns="using:Uno.Toolkit.UI.Material" />
I am working on a DotNetNuke module that obviously uses web controls to show different pages.
I would like to have some shared content on all pages(web controls). In fact I am using bootstrap to render my menu items which it has a markup like this :
<div id="pageWrapper" class="active">
<div id="sidebar-wrapper">
my menu content
</div>
<!-- Page content -->
<div id="page-content-wrapper">
<!-- Keep all page content within the page-content inset div! -->
</div>
</div>
So what I really want is to have a way to have this markup in all of my web controls and to be able to put the control content in the page content section.
If I could use pages I would use a master page to achieve this but the question is how can I do the same with web controls ?
My XML is something like this.
.
.
.
</body>
<List>
<topicTitle>This is topic title</topicTitle>
<topDef>This is topic definition.</topDef>
</List>
I basically want to insert topicTitle and topDef into <li> tags. And I am trying to do so with this code (code for topicTitle shown only for simplicity):
<!-- TemplateBeginRepeat name="List" -->
<!-- TemplateBeginRepeat name="Field.topicTitle" -->
<li>##RenderComponentField(FieldPath+".value",
TemplateRepeatIndex)## </li>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
But it doesn't seem to be working. Any ideas?
In case of embeddable schema you don't need to iterate over xmlList (with TemplateBeginRepeat) unlike Component link, here you can directly access the embedded child element via syntax:-
##Component.XMLNameOfEmbeddedschema.XmlElementNameinEmbeddedSchema##
pls note in above XMLNameOfEmbeddedschema = the XMLName you give in parent schema while inserting an embeddable schema.
So in your scenario it will work with
##Component.List.topicTitle## for accessing value of topicTitle.
Please mark this answer as accepted, if this solution works for you...
I am working on DWT TBB in SDL Tridion 2011 SP1.
I have a embedded field "body" which is multivalued. In this embedded field I have one more simple Text field "value", which is again multivalued.
To render the "value" field I have to use two repeating loops.
But I am unable to differentiate the Indeces of the both loops.
I have written as follows.
<!-- TemplateBeginRepeat name="Component.Fields.body" -->
<!-- TemplateBeginRepeat name="Component.Fields.body[${TemplateRepeatIndex}].value" -->
<div>##RenderComponentField("Fields.body[${TemplateRepeatIndex}].value", TemplateRepeatIndex)## </div>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
I am unable to render the fields.
Can any one help how to handle multiple nested regions in DWT TBB.
Thank you.
The Tridion practice page that Neil referred to is a good reference. But that page shows how to generically iterate over all embedded fields. In cases where you know the field name, things get a bit easier. In you case, this is all that is needed in your DWT:
<!-- TemplateBeginRepeat name="body" -->
<!-- TemplateBeginRepeat name="Field.value" -->
<div>##RenderComponentField(FieldPath+".value",
TemplateRepeatIndex)## </div>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
Line by line:
Iterate over the values of the body field of your Component
Iterate over the values of the value subfield of your body embeddable schema
At this stage the FieldPath refers to the current body value, so body[0], body[1], etc. and TemplateRepeatIndex is the index of the current value. So we can construct the correct RenderComponentField call with this knowledge.
Example
I have a Component with two body fields, each with two value fields. So the XML is:
<Content xmlns="uuid:8841d68e-7b1b-45cd-a6d6-7e7da5de3ef9">
<body>
<value>body1.value1</value>
<value>body1.value2</value>
</body>
<body>
<value>body2.value1</value>
<value>body2.value2</value>
</body>
</Content>
The output from the above DWT on this Component is:
<div><tcdl:ComponentField name="body[0].value"
index="0">body1.value1</tcdl:ComponentField></div>
<div><tcdl:ComponentField name="body[0].value"
index="1">body1.value2</tcdl:ComponentField></div>
<div><tcdl:ComponentField name="body[1].value"
index="0">body2.value1</tcdl:ComponentField></div>
<div><tcdl:ComponentField name="body[1].value"
index="1">body2.value2</tcdl:ComponentField></div>
Debugging these situations
Many people have problems writing constructs like these. I am no exception, I have just found that I can get most cases working by knowing that the crucial variables are: Field, FieldPath and TemplateRepeatIndex. When in doubt, simply embed this fragment into your DWT inside every TemplateBeginRepeat.
(FieldPath=##FieldPath##, TemplateRepeatIndex=##TemplateRepeatIndex##)
Does the FieldPath variable not help you here?
See the Tridion Practice site for an example of iterating over multivalue embedded fields.
As you noticed already, you cannot use the outer loop index inside the inner loop. The inner loop index will hide the outer loop index. Therefore, you need a workaround. I can think of 2 that I used in the past:
Use a C# TBB (either assembly or fragment) to generate the output. This is not a very nice solution, but it is practical. You could at least generate the output of the inner loop and store the individual values in Package variables. Then in the outer loop you can simply iterate over the values and include them in the output. Example: create variables called body_0, body_1, etc. Then output them inside the outer loop using ##body_${TemplateRepeatIndex}##
Use Dreamweaver functions to simulate the inner loop index. You can have a function to Set a Package item variable, and one to Increment it. Then use this variable inside the loops. Example:
<!-- TemplateBeginRepeat name="Component.Fields.body" -->
##Set("i", 0)##
<!-- TemplateBeginRepeat name="Component.Fields.body[${i}].value" -->
<div>##Component.Fields.body[${i}].value[${TemplateRepeatIndex}]</div>
<!-- TempalteEndRepeat -->
##Increment("i")##
You will have to write the Set and Increment DWT functions yourself to store and increment a value in the Package.
Try this way:-
<!-- TemplateBeginRepeat name="Component.Fields.body" -->
##Push("PrimaryIndex", TemplateRepeatIndex)##
<!-- TemplateBeginRepeat name="Component.Fields.body[${PrimaryIndex}].value" -->
##Push("SecondaryIndex", TemplateRepeatIndex)##
<div>##RenderComponentField("Fields.body[${PrimaryIndex}].value", ${SecondaryIndex})## </div>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
UPDATE 1:
Just I got an idea on this. How about doing this way?
<!-- TemplateBeginRepeat name="Component.Fields.body" -->
<!-- TemplateBeginRepeat name="value" -->
<div>##Field##</div>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
Without using any TemplateRepeatIndex
For those who are using Tridion 2009 without SP1 version (like our customer), 'FieldPath' variable cannot be used as suggested in the earlier answers. But there is a simple way to achieve this in DWT itself as given below in the example code:
<!-- TemplateBeginRepeat name="Component.body" -->
<!-- TemplateBeginRepeat name="Field.value" -->
<div> ##Field##> </div>
<!-- TemplateEndRepeat -->
<!-- TemplateEndRepeat -->
I need to put two tabs on my aspx page (c#). Is there already done tabs control for aspx ?
Ajax has tabs you can use:
http://www.asp.net/ajax/ajaxcontroltoolkit/samples/tabs/tabs.aspx
jQuery also has tabs you could use, which in my opinion is the better choice:
http://jqueryui.com/demos/tabs/
In strictly ASP.NET you can use multiview, and make tabs, here is a tutorial for that:
http://www.codeproject.com/KB/custom-controls/TabControl.aspx
Bootstrap is commonly used with aspx so I used it on my webpage for tabs.
This is a tutorial page.
Please find below an example for two tabs:
<div id="Tabs" role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="active">Settings tab</li>
<li>Information tab</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="settings">
</div>
<div role="tabpanel" class="tab-pane" id="info">
</div>
</div>
</div>
You need to have bootstrap.css and bootstrap.js references in page head section.
[Reposting my answer because 3 people felt the need to trash my first attempt. One person made it worse by making the URL opaque, so that you can't see it's w3schools.com, a known good tutorial site. Another criticized it for not providing context, like why its approach might be desirable. And a moderator deleted it summarily for none of the reasons I can see posts are supposed to be deleted. Go ahead and remove this commentary, but don't sandbag me and destroy my effort to help others from an ivory tower.]
If you want to send down all the tabs' contents and just have a locally (and instantly) swapped experience, I recommend https://www.w3schools.com/howto/howto_js_tabs.asp. You put your content in divs, and use just a tiny bit of JavaScript to swap out which one is visible. No extra/3rd-party component or framework, just simple HTML/JS that just works.
Super simplistic subset from the above: Content in divs like <div id="tab1">content</div>, then show one with document.getElementById("tab1").style.display = "block"; and hide the others with none instead of block.
There is no standard ASP.NET component, but you can use Microsoft's ASP.NET AjaxControlToolkit library.
Here is the component
You can create simple menus using CSS. This site shows you step by step how to create one, which you can then customise as required.
http://www.secondpicture.com/tutorials/web_design/css_ul_li_horizontal_css_menu.html