Skip to end of metadata
Go to start of metadata

Is there a way to use builder-show to only output something when a page with a scaffold on is being edited (in scaffold edit mode)?

E.g. I tried this setting the page contents to this:

A description - {text-data:description|type=area}{text-data}
{builder-show:action=editscaffold}test{builder-show}

But it doesn't show up. The action URL for scaffold editing is <confluence>/pages/scaffold/editscaffold.action?page.... I've also tried setting the builder-show action to scaffold/editscaffold but no luck there either.

  • No labels

7 Comments

  1. Unknown User (gfraser)

    Scaffold uses something called "Conveyor" to override Confluence actions and make them behave differently, and as a result it's often difficult for other plugins to know when a scaffold is being viewed or edited.

    From vague memory, recent versions of Builder have something that allows switching based on URL (or I might be getting mixed up with user agent?).

  2. Your best bet is going to be to ensure that the debug comment is switched on (options tab of your layout - it is on by default) then view the html source of the page - at the top of the html will be a debug comment that will tell you various bits of information that builder has extracted about the page that is being viewed.

    eg here is the comment from this page:

    <!-- main.vmd
    helper: com.atlassian.confluence.themes.GlobalHelper@6c60edf7
    action: com.atlassian.confluence.core.ConfluenceActionSupport@4fa72ab7
    action.helper: com.atlassian.confluence.themes.GlobalHelper@6c60edf7
    action.globalHelper: com.atlassian.confluence.themes.GlobalHelper@6c60edf7
    -->
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
     <!--
      userAgent: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9) Gecko/2008061004 Firefox/3.0'
      layout : 'com.adaptavist.confluence.builder.layouts.model.Layout@67e57d3b'
      layoutId : 'CLEANSIDEBAR'
      spaceName : 'Theme Builder Plugin'
      currentURL : '/display/Builder/builder-show+and+scaffold?focusedCommentId=39944384&'
      contextPath : ''
      action name : 'viewpage'
             *********
      adaptavist.builder.sitemeshPage: com.opensymphony.module.sitemesh.parser.FastPage@b80e1c7
      adaptavist.builder.helper: com.atlassian.confluence.themes.PageHelper@3a66d5b7
      adaptavist.builder.labelsString: null
      adaptavist.builder.pageTitle: builder-show and scaffold
      adaptavist.builder.mode: view
      adaptavist.builder.context: page
      adaptavist.builder.decorator: page
      adaptavist.builder.pageContext: com.atlassian.confluence.renderer.PageContext@66ec46e2
      Current adaptavist.builder.layoutId: CLEANSIDEBAR
      Latched adaptavist.builder.layoutId: null
    -->
    

    I think Guy is referring to the fact that from 3.3.4 builder is now able to switch on action titles as well as page titles.

  3. Unknown User (liam.jones)

    Thanks both, I'm guessing Guy's point about the Conveyor causing issues could be it. If I do edit the scaffold and then view the page source the debug comment says the action name is what I already tried, editscaffold:

    <!--
      userAgent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4) Gecko/20090423 Firefox/3.5b4'
      layout : 'com.adaptavist.confluence.builder.layouts.model.Layout@3383e5'
      layoutId : 'DEFAULT'
      spaceName : 'Test'
      currentURL : '/confluence/pages/scaffold/editscaffold.action?pageId=23593022'
      contextPath : '/confluence'
      action name : 'editscaffold'
             *********
      adaptavist.builder.sitemeshPage: com.opensymphony.module.sitemesh.parser.FastPage@1ab320f
      adaptavist.builder.helper: com.atlassian.confluence.themes.PageHelper@637cc5
      adaptavist.builder.labelsString: null
      adaptavist.builder.pageTitle: Test template
      adaptavist.builder.mode: edit
      adaptavist.builder.context: page
      adaptavist.builder.decorator: page
      adaptavist.builder.pageContext: com.atlassian.confluence.renderer.PageContext@3e3de1a5
    -->
    
    1. It's likely that the editscaffold data is appearing at the point of rendering main.vmd ... the panels for a page however are rendered at page.vmd where the data is likely to be unavailable due to the way that conveyor works ... you should ideally contact customware and ask them to create a version of scaffold which doesn't contain the conveyor hack.

      One workaround may be to use the flag code.

      eg, add the following to your scaffold template:

      {set-flag:scaffold}
      

      Then use the following code in your layout:

      {builder-show:flag=scaffold} whoo! {builder-show}
      
  4. Unknown User (orgetex)

    How do I show content only it a specific value on scaffold data exist.

    Would assume that it works like following:

    {text-data:type}Testtype-A{text-data}
    
    {builder-show:metadata:data:type=testtype-A} content/message here {builder-show}
    

    Is there a way to achieve this? - even with another way/macro to use!

    1. You need to find out whether the scaffolding plugin is compatible with the metadata plugin's prefix key (which I suspect it is not)

      1. Unknown User (orgetex)

        deleted comment sorry was wrong by accident!