Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Galina 44 posts 258 karma points
    Nov 19, 2014 @ 08:44
    Galina
    0

    Add css class to usercontrol-macro in RTE

    Hello.

    I have a usercontrol macro with css-class. I added css-file with this class to umbraco/#/content/content/edit/idPage  and saw

    <head><link href="/styles/modules/search/search_results.css" rel="stylesheet" class="lazyload" charset="utf-8"></head>

    but when I added a macro with class from search_results.css, but there are no style. Why? What should I do to add style?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 19, 2014 @ 08:58
    Jan Skovgaard
    0

    Hi Galina

    What is it exactly you're trying to do? Is it modifying the umbraco backoffice or a part of your website?

    /Jan

  • Galina 44 posts 258 karma points
    Nov 19, 2014 @ 09:17
    Galina
    0

    Hello, Jan.

    I've created custom RTE using http://umbraco.github.io/Belle/#/tutorials/manifest ;

    package.manifest

    {     

        propertyEditors: [      

    ...

     css: [

    "~/styles/modules/search/search_results.css"

    ]

    }

    after that, in http://myhost/umbraco/#/content/content/edit/pageId ,  I saw

    <head>

    ...

    <link href="/styles/modules/search/search_results.css" rel="stylesheet" class="lazyload" charset="utf-8">

    ...

    </head>

    But when I added usercontrol macro 

    <ul class="bPanelLinks">

    <li>test</li>

    </ul>

    I don't see my style. In preview mode I saw it. How should I add my custom css, if I want to see it in Umbraco backoffice?

     

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 19, 2014 @ 22:51
    Jan Skovgaard
    0

    Hi Gallina

    Hmm, have you tried clearing the cache? When working with property editors styles etc. are cached pretty hard so sometimes you need to hard reload the page and empty the cache.

    If that does not help then try doing this

    1: Go to the /app_data/TEMP/ClientDependency folder and delete the files from here 2: Go tot he /config/ClientDependency.config and increment the version attribute 3: Recycle the app pool 4: Reload your backoffice and see if the styles are present now

    If this does not work...can you see the styles on the elements from your property editor if you inspect the dom? If the style declarations are present but overlined then you need to add more specificity to your styles.

    /Jan

  • Galina 44 posts 258 karma points
    Nov 20, 2014 @ 09:31
    Galina
    101

    Hello Jan.

    The problem wasn't in settings. TinyMCE add iframe to page with nested tag

    <html><head>...</head> ... </html>

    package.manifest add file.css to main Umbraco backoffice page (not to iframe)

    And it's needed to add 

    angular.module("umbraco").controller("OzonRTEController", function($scope, $routeParams, $http) {
        $scope.property = {
            view: 'rte',
            config: {
                editor: {
                    toolbar: ["code", "undo", "redo", "cut", "styleselect", "bold", "italic", "alignleft", "aligncenter", "alignright", "bullist", "numlist", "link", "umbmediapicker", "umbmacro", "table", "umbembeddialog"],
                    dimensions: { height: '400px' },
                    stylesheets: "basic.css"
                }
            },
            value: $scope.model.value
        };

    stylesheets: "basic.css" -- this file should be placed in ~/css/ without any nested folder 

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Nov 20, 2014 @ 09:32
    Jan Skovgaard
    0

    Hi Galina

    Aaah cool, happy you managed to figure it out and thank you for sharing the solution :) #h5yr! (High 5 you rock).

    Cheers, Jan

Please Sign in or register to post replies

Write your reply to:

Draft