15

A couple of steps are necessary in order to get Tridion to use a CSS preprocessor, but it certainly can be done: Install Sass on the Tridion server. Since Tridion runs on windows machines, you should install first Ruby, and then Sass. You need to be able to build Sass things from the command line. Make sure that .scss is a valid mimetype. Within the ...


14

In a Component Template TBB, you don't have (direct) access to the Page object. The property ContextItem would return the Component that is being rendered with the current Component Tempalte. Please check that, as I'm not familiar with what TridionHelper should do. Hence your code ContextItem as Page will return null. Back to your question -- how to pass ...


10

I'm not sure there is a correct answer here... i think it's based on the client needs. Here's an opinion... It's now possible to store binaries in the broker database, it makes a great case for managing them in the CMS, so that external 'consumers' (development teams, partner websites, load balanced machines, etc) can consume / store these files and ...


9

In addition to Nick's technical answer, I want to add the philosophical angle -- Why would you want to modify a field during template execution? While technically this is possible, it makes no sense to do so while the template is executing. I understand you want to change a field value, then save the Component to propagate your change to the CM database. ...


9

The CD side does not know anything about ECL items at all. So you have to deal with them in your templating code in CM. This means if any metadata (either type) has to be published you need to do this from your template. You also have to resolve the ECL URI into either something binary downloaded from the external system and included in the package (this ...


9

According to this helpful post by Dominic Cronin You can use "text" tags in order to do this. So the final if statement looks like this: @if (Fields.releaseMediaTitle == null) { <text> <div class="col-sm-12"> <a href="http://www.example.org"> </text> } else { <text> <div class="col-sm-8"> &...


8

I agree with John that it would be based on the clients needs, but also in relation to what development and deployment model you have chosen. When looking at the different implementation options, I like the simplicity of having HTML in your (DWT) Templates and then often will go for Publishing CSS and JS as Pages (personally hate the idea of using ...


8

If you are using Razor Mediator to build your layout you can use its built-in function IsSiteEditEnabled. The Razor Mediator v1.3.3 documentation has the following example. @if (IsSiteEditEnabled) { <div>Component Title: @Component.Title</div> }


8

Here is the logic that I use with clients (and chiming in with what Alvin said): C# is code, therefore belongs in a code repository (e.g. SVN). Java is code, therefore belongs is a code repository. SQL scripts is code, therefore belongs is a code repository. .... should I go on? So what makes JavaScript or CSS any different? It is code that also needs to ...


8

You have three options to retrieve any values from the package, which would include parameter schemas: @Package.ItemName @Package.GetByName("ItemName").GetAsString() @Package.GetValue("ItemName")


7

In the Templating Base project on SDL Tridion World there is a method GetPage() this is something which usually is called on a Page Template only, but can also be used to get to the Page object on a Component Template (provided it exists, which is only the case for embedded Component Presentations when they are published, or the Page they are on is previewed)...


7

The code inside the <!-- TemplateBeginRepeat --> has context... Just test your value as such. Also, you need an "is equal to" operator, rather than an "equals" I think ;) The following works for me... <!-- TemplateBeginRepeat name="OffersText" --> <!-- TemplateBeginIf cond="Select == 'Offer A'" --> <div class="col-sm-3 ...


7

I don't think it's possible without a custom TBB. For short, the idea is to map Structure Groups to the Folders containing your Multimedia Components, then use these SGs when publishing a given MM Component. The creation of the mapped Structure Groups is something that could be done via event system, when saving a MM Component. The publishing part would ...


7

There's an infinite number of ways to achieve this. What is best depends entirely on your scenario; however, if you are looking simply to inject a snippet of Javascript into a manually-selected set of pages, the easiest and most flexible way I can think to achieve this would be along the lines of the following: Create a 'Plain Text' or 'Code' Schema, which ...


7

The simplest way to add JS to your header in your Tridion implementation is to keep JS out of the Tridion CM and deal with it purely on the presentation side. To do this, simply render the path to the file on your presentation server. This means keeping your JS bundled along with other presentation side code. See this Q&A for further insight on the ...


7

Dreamweaver templating is not really intended to support generic programming constructs beyond simple loops and conditionals. Yes - you can manage to get it to do more than that, especially if you are prepared to create and install a function source assembly. There are enough people who will be happy to share tricks to make Dreamweaver templating do your ...


7

I will assume you are using Tridion 2013. Then you have 3 choices of Template Mediators in your architecture: DWT Razor Mediaor XSLT I prefer the Razor Mediator myself, since it has the best balance of features and ease of use. I have written a VBScript -> Razor wiki here The Razor Mediator also has great documentation and is used very often as a ...


7

A way to pass variables across template scopes of the same rendering session is via Context Variables hash map. See Tridion docs for usage. A mix of concerns is a caveat to consider here. So this kind of approach, my opinion, is tough on maintenance and not ideal. Note, using this approach you will not be able to debug your CTs in Template Builder because ...


7

There are normally three places that I would check for character display issues such as this: Do the characters look correct inside of the Components in the Tridion Content Management Explorer (CME)? Can you open the published page (assuming that this is not a Dynamic Component Presentation) in Notepad++ or similar on the web server? Do the characters look ...


7

The Publisher for sure caches objects, but the lifetime of that cache is normally from the point the the Publish Transaction is picked up from the queue to the point that rendering (of all items in the Publish Transaction) is done. There is a possibility to configure a shorter lifetime (only during rendering of individual items) but this is normally not ...


6

After some investigation, it turns out there is nothing wrong with my code, but the problem comes from windows. In the callstack we can see there is a call to the function System.IO.Path.InternalGetTempFileName(Boolean) This function takes care of creating a unique temp file in the c:\windows\temp directory. After inspection of this directory on my ...


6

I think Bart and John did a good job explaining the mechanisms of how to deal with CSS/JS. I want to chime in regarding whether to publish them as binaries or not. I am a strong believer that you should not store CSS/JS as binaries (i.e. Multimedia Components). I don't think it's the right way. The whole contention point starts with the way these assets are ...


6

I'd personally keep them outside Tridion because both Javascript or CSS files do not really relate to the content managed in the CMS, specially when using a framework such as DD4T


6

The razor mediator is trying to find a component when the TcmId is null or empty. If you look in your component's source tab there should be a component link element of some sort with an empty xlink:href attribute. Remove these and retry and you should be okay. As to why these are there I'm not 100% sure. It seems most likely to be because the element ...


6

OK, to answer my own question: Follow these steps to add the UploadAssemblies2.dll to VS2013: Find your Projects location (in VS2013 TOOLS -> Options -> Projects and Solutions -> Projects location); Create an "Addins" directory and copy&paste the content of the Upload Assemblies zip file to this directory; Update the Upload Assemblies2.AddIn file: ...


6

There's probably a number of ways to do this, here is roughly how I would look at implementing: create a multimedia type in the CMS to support the .scss file extension associate that mm extension to an existing or new multimedia schema (i'd probably do a 'sass' specific schema so it can have a 1-1 relation ship with a component template) Associate your '...


6

Yes, there is a way to debug tridion templates locally. @Rob has provided a wonderful facility called the "TcmDebugger" which enables the ability to debug templates locally without connecting to a remote TcmTemplateDebugHost.exe. What is TcmDebugger? TcmDebugger is a .NET console application which runs the SDL Tridion Content Manager render/publishing ...


6

Problem is solved .problem was because of we migrate cms database from one server to other server and in QUEUE_CONSUMERS table the old Host was still online after changing it to offline i m able to update TBB.


6

If you are using normal Modular templating, the usual approach is to write a .NET TBB which you can put in your page template(s) and which uses some logic to read the 'Main' component on the page, extract the metadata from it and push it into the package to be written out in your Page Template Layout.


6

Assuming this is compound templating and we are talking about a page template I would suggest breaking up the page template into separate visual blocks to be rendered as component presentations (as is the "standard" way of building up pages in SDL Tridion). Having one page template do everything means you are in code implementing a lot of variability that ...


Only top voted, non community-wiki answers of a minimum length are eligible