Define css files dynamically

13 posts, 0 answers
  1. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 21 Sep 2007 Link to this post

    Hi,

    I would like to define dynamically css files used in the custom "Apply CSS class" drop down.

    for example, in some pages or spweb, i would like to show custom css class.
    However, in other ones, i don't want to show them.
    i.e. : Depending on the context, i need different css class

    I did not find a way to do it easily with the current RadHtmlField.
    One solution would be to define a different config file for each spweb or page, but it would be really difficult to maintain (because there is more information in the config file than the css files only)

    I think RadEditor defines a Property called "CssFiles" which can be used to define css file.
    However, the MOSSRadEditor (the derived class of RadEditor) which is contained in the RadHtmlField is private, so I can't define the property.

    I think there are at least 2 solutions:
    - Show the property "CssFiles" on the RadHtmlField
    - change "private MOSSRadEditor radEditorControl" to "protected ..."
    or....?

    Thank you,

    Sylvain
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 21 Sep 2007 Link to this post

    Hello,

    We have decided to make the radEditorControl protected so it can be used from derived controls. This should provide you with the ability to change virtually every property dynamically. The update will be available in the next MOSS editor release (planned for next week).

    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  3. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 24 Sep 2007 Link to this post

    Hello,

    Thank you for your quick answer.
    I am looking forward to test the next release :)

    Regards,

    Sylvain


  4. Tom
    Tom avatar
    7 posts
    Member since:
    Jul 2006

    Posted 24 Sep 2007 Link to this post

    I am also looking forward to that feature. That and the MOSSLinkManger bug correction.

    Thanks,
    Tom
  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 25 Sep 2007 Link to this post

    Hi Tom,

    I just checked the changelog for the upcoming release and did not see an issue, related to the link manager. Could you describe it or post a link to the thread where it is discussed, so I can add it in the changelog?

    Sincerely yours,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 04 Oct 2007 Link to this post

    Hi,

    Do you know when the next release will come up?
    I need the fix for defining css files for tomorrow (the fix is to change a private attribute to protected ...).

    If there is no release this week, is it possible for you to send me a pre-release version?

    I can't open a support ticket because I did not buy RadEditor for MOSS yet (only rad controls for Asp.net...)

    Thanks a lot

    Sylvain
  7. Tom
    Tom avatar
    7 posts
    Member since:
    Jul 2006

    Posted 04 Oct 2007 Link to this post

    Set a custom path to the ToolConfig.xml in the RadE Tag

    Place the RadE tag on the PageLayout into a User Control.

    In the onload event of the user control you can use CAML to scan the listid via the SPSiteDataQuery.

    Replace the custom path to whatever configuration you want for that listid/


     

  8. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 04 Oct 2007 Link to this post

    Hi tom,

    thx for the solution, but I don't want to define All settin each time.
    I just want to change the css files !
    ...
  9. Tom
    Tom avatar
    7 posts
    Member since:
    Jul 2006

    Posted 04 Oct 2007 Link to this post

    I assume you installed this throught the convetional solution package telerik provides (can be found in a whitepaper on this site):

    Then just add a class file called CssEditor.css to
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\4.3.2.0__1f131a624888eeed\RadControls\Editor

    (change 4.3.2 to 4.3.1 for older version)

    The editor will add your styles to the defualt styles listed in the dropdown.

    However, if you want to change the actual dropdown for 1 to N users you will have to follow my last post and confiure the ToolsXML file.

    And you will want to move the file into a central location and so that your customization isn't lost when you install future versions.

    Hope this helps.

    Tom

  10. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 04 Oct 2007 Link to this post

    Thank you for your quick reply.

    However :
    If I understood your explanation, in the end, your solution is to define programmatically (depending on the context) the path to a config file.

    The problem is that, depending on the context, I want to include file1.css, file2.css, file3.css and file4.css; or file2.css and file25.css...

    I cannot write the config files for all combinations (because there is too many css files and because the number of css files change).

    Thanks anyway ;)

    Sylvain
  11. Tom
    Tom avatar
    7 posts
    Member since:
    Jul 2006

    Posted 04 Oct 2007 Link to this post

    I see the difference, now. I haven't had to push the editor in that way yet...

    I have a couple therories that may do it, but would need to be taken into the lab to prove them out. 

    At a minimum you need a lookup table (likely XML), a way to read the context of the page loading and then a routine to match things up.

    Assuming this is already done, maybe there is a way to dynamically put these properties directly into the RadE tag itself.

    You would still have to use a usercontrol, but if the tag properties override the loaded css it could work.

    The other thought would be to define one massive CssEditor.css file and then using the various to ToolConfig.xml method, you could hide / show the classes in the various ToolConfigs based on the page loading context.

    This would be about as much maintenance as keeping on top of all of the different css files and probably the first thing I would try.

    Let me know how it finally turns out.

    Tom












  12. viex
    viex avatar
    22 posts
    Member since:
    May 2007

    Posted 05 Oct 2007 Link to this post

    I just saw the new Release : the 4.4.0 version.

    Now the MOSSRadEditor in the RadHtmlField is protected, so I will be able to define css files.
    I did not test it yet, but I have good hopes.

    Thanks Telerik team (and tom)
  13. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 05 Oct 2007 Link to this post

    Indeed, version 4.40 was released yesterday. Let us know if you have any problems with the new bits.

    Lini
    the Telerik team
Back to Top