0

In Dreamweaver Templating we can access the fields of a component in two ways.

  1.@@Component.Field.FieldName@@
  2.@@RenderComponentField("FieldName",0)@@

similarly to access the Component Presentation

  1.RenderComponentPresentation()

Is there way to access it in another way.

Patan
  • 17,073
  • 36
  • 124
  • 198
  • Can you explain more about what you're trying to do? – Nuno Linhares Aug 03 '12 at 06:19
  • @NunoLinhares. Just want to restrict some of the component presentations in not editable in site edit. If I Use RenderComponentPresentaion() it will make it editable right? – Patan Aug 03 '12 at 07:01
  • 1
    Only if they use the Enable SiteEdit TBB (or enable inline editing for Tridion UI 2012). If you don't want them to be editable, then don't use the TBB in those templates. I don't think there's a way to render a CP that bypasses SiteEdit completely... – Nuno Linhares Aug 03 '12 at 07:32
  • 1
    Calling `RenderComponentPresentation` or `RenderComponentField` does nothing more than marking the Component Presentation or Component Field in the HTML. It is (as Nuno says) up to other TBBs to translate those markings into feature-specific formats. So Enable SiteEdit will translate the markings into SiteEdit comments, while the Component Link Resolver will do something else with them. Simply don't include those TBBs to not enable that feature. – Frank van Puffelen Aug 03 '12 at 12:51

5 Answers5

5

You should really consider editing your question and clarifying it a bit to make it more clear of what you are asking. Reading all the answers you dismiss and their comments, I think what you are trying to accomplish is to have some Component Presentations on the Page editable and others not.

Depending on the version of SiteEdit you are using there are two solutions:

  1. SiteEdit 2009 SP3 - You should remove the inline editing TBB from the Component Template which you do not want editable, the Page will still generate a hover-over the Component Presentation so it can be moved.

  2. UI 2012 (the new UI or Experience Manager) - You can disable inline editing per Component Template, through the checkbox in the Component Template.

If you also need to have the hover-over on the Component Presentations removed, then I think the only solution is to remove the Inline Editing features of the Page Template (for SE 2009 SP3, remove the TBB and for UI 2012 disable it on the Page Template) and generate all the required SiteEdit marking yourself in the Page Template.

An interesting question to all this would be "why?", what is your requirement exactly to have the need for only enabling inline editing on some of the content on the Page. Since you could also accomplish that through (editing) permissions for certain user groups.

Bart Koopman
  • 4,835
  • 17
  • 30
4

The default TBBs that ship with Tridion, SiteEdit 2009 and the new UI/Experience Manager all insist on generating markup around Component Presentations and Component Fields. You can control the markup elements they generate, but there is currently no way to turn them off.

To gain such full control, I created a simple extension function for use in DWT templates. You can find it here: http://code.google.com/p/tridion-practice/wiki/TridionUI2012FunctionsForUseInHtmlTemplates

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1

RenderComponentPresentation would be from the Page Template, and the first examples are from the Component Template, or within e.g. a repeating region:

<!-- TemplateBeginRepeat name="Components" -->

    Fields.*FieldName*

<!-- TemplateEndRepeat -->

But either way, why are you asking?

Arjen Stobbe
  • 1,684
  • 9
  • 15
  • @Arjeb Stobbe. Thanks for the response. I am aware of that. If add "Enable Inline Editing for the Page". It will add wrap all the presentations with span elements. I want to restrict it to some only. – Patan Aug 03 '12 at 06:24
  • Only RenderComponentField does that, if you dont want it to happen you should output the Package Item Fields Value directly. (@@Component.Fields.FieldName@@) – Arjen Stobbe Aug 03 '12 at 07:25
1

You can also call RenderComponentPresentation from within another Component Template, using this code:

@@RenderComponentPresentation(Component.ID, ComponentTemplate.ID)@@

Where the arguments are the tcm ids of the component you wish to render, and the template to render it with.

Dave Houlker
  • 1,435
  • 10
  • 19
  • Thanks for the answer. I am aware of that. If add "Enable Inline Editing for the Page". It will add wrap all the presentations with span elements. I want to restrict it to some only. – Patan Aug 03 '12 at 06:23
1

For dynamic component presentations you can use the following in a page template:

<tcdl:ComponentPresentation type="Dynamic" componentURI="${ComponentID}" templateURI="${DynamicComponentTemplateID}" />

But in this case these dynamic component presentations won't be published during the publishing page. So, you should publish them before publishing page.