Forums

Alter theme of Telligent Community 5.0

This question has suggested answer(s)

In community server 2008.5 we modified a lot off aspx code with own div's and other html tags.

With the new set up with content fragments this is no longer possible unless we alter the code with the SDK.

Is my assumption right?

 

Regards

Danny

All Replies
  • I think you still should be able to do your own aspx/ascx modifications like you used to do. In fact with new Community server there is much more space for theme modifications.

    As far as content fragments - I think you can even use your old aspx. There is new content fragment-related control class ExternalImplementedContentFragmentBase, so with it your own content fragment could be very simple to implement. For example:

       public class MyControl : ExternallyImplementedContentFragmentBase

       {

           public MyControl() : base("~/Utility/ContentFragments/my_old_theme_file.ascx")

           {

           }

           public override string FragmentDescription

           {

               get

               {

                   return ResourceManager.GetString("MyControl_Description");

               }

           }

           public override string FragmentName

           {

               get

               {

                   return ResourceManager.GetString("MyControl_Name");

               }

           }

       }

    You can see lots of Telligent examples of those ascx content fragments at /web/Utility/ContentFragments.  When you put your assebmbly into /bin system will pick it up. You even don't need SDK for this.

    That's it, at this point your content fragment should be available for management at localhost/.../managewidgets.aspx and you can place it anywhere in /Web/Themes/generic/ just like  it defined in default fiji or evolution2 themes.

    Also you can play with new option to alter content fragments in theme.config.

  • Oops, at this point I found new Telligent Evolution Platform documentation and specifically this article. I've this bad habbit to use reflector before reading docs :)


     

  • The Widgets still use the same old Chameleon markup you're used do Smile

    Another thing to bear in mind there's a lot more you can now do with CSS Overrides.  Both the Community (fiji) and Enterprise (evolution2) themes are (mostly) CSS Overrides of the base Generic theme.  Everything in the generic theme has explicit CSS classes.  so you can apply style changes to individual widgets easily.

    Take the Blog Post List widget as an example.  If you don't want to show the fitler area at the top, you can use

    .content-fragment.blog-post-list .filter

    {

    display: none;

    }

    Don't want to show the rating control, use

    .content-fragment.blog-post-list .post-rating

    {

    display: none;

    }

    Those parts of the fiji / evolution2 themes which aren't made through CSS overrides are made through Markup Translations in the theme.config file.

  • Thanks for all the sugestions. This works for new files we added.

    We also did made a choise to alter CS aspx and master files by adding div, span and removing certain CS controls. This is something wich is no longer poossible I think

  • You can alter the prepackaged widgets although it's strongly reccomended against - they're all stored in /utility/contentfragments/

    If you're only adding divs / spans and removing some CS controls you should be able to do that using Markup Translations (these use regexes to find certain patterns and then replace them with other strings).

    For example with markup translations, you could use the following to add add <em></em> after any standard <p> tag:

       <Translation>

         <Match><![CDATA[(<p>)]]></Match>

         <Replace><![CDATA[$1<em></em>]]></Replace>

       </Translation>

    You can also do some more fancy translations using regexes to reorder content, or totally remove content.

  • Markup translation is a nice thing, as well as widgets filtration based on location and application type. Maybe I overlooked something, but it looks like this new widgets-related features lack support of quite obvious thing which is role-based widget filtration. The feature which we implemented in our product for CS 2008 like more then year ago, because what we learned from content fragments is that sometimes CF could be quite dangerous.

     

  • In what cases do you want / need role filtration of widgets?  Widgets should not render anything the current user does not have access to.

  • Alex,

    I'm talking about custom widgets, when it's not possible to hard-code and check all roles in content fragment. There are a lot of cases when it's required such as integration with other systems, cross sites integration, etc. Simple example - calendar for group(s) of people.

  • Are you trying to adjust permissions for who can add the widget or who can see the widget?  If the former, that can be controled through the control panel.  With the latter, if the user control has no visible cotnent to render, the widget won't render.  You can therefore just override the Visible property of the UserControl to control whether the widget is visible or not.  

  • Both permissions in general. And it's not possible in control panel to define who can add what widget and where to.

    Of course it's always possible to do hacks here and there to make it work like customers want it, but I'm talking about legit core product feature which is missed atm.

  • Sorry the message should not be verified.

    So if I am correct and I want to add some tags in the navigation bar I can edit the header fragment graoupnavigation.ascx