1. #1
    Sencha User olivierpons's Avatar
    Join Date
    Dec 2009
    Location
    Aix en Provence,France
    Posts
    116
    Answers
    6
    Vote Rating
    1
    olivierpons is on a distinguished road

      0  

    Question Answered: Image, theme, paths and relative paths: how to override/change the behavior?

    Answered: Image, theme, paths and relative paths: how to override/change the behavior?


    Hi,

    As you may (or may not) know, to make downloads parallels, faster, for a website, you must have static files on another domain than the current one (see example below).

    So I've written my whole (own) framework based on this principle.
    So all the files are "dynamically" coded this way:

    http://[languague].static.mydomain.com/[image file].(png|jpe?p|gif)
    http://[languague].static.mydomain.com/[text file].txt
    http://[languague].static.mydomain.com/[css file].css
    http://partner.mydomain.com/[dynamic file](.php|/)

    You may guess that I'm having very hard times with ExtJS, because (and that's a good point for people who are not concerned about optimization) all the paths are relative.

    Thus here's what I've done:

    [ext-all.css] - I've renamed all the "../../ext/resources/..." to "{{host_static}}/ext/resources/..." which is dynamically renamed to the right static domain name (e.g. http://fr.static.mydomain.com/ext/resources/themes/images/default/dd/drop-no.gif)

    everything works so far.

    But now, I'm using an Ext.grid.Panel component with buttons, and the icons do not show, and do not generate 404 errors (that's my problem actually):

    iconCls: 'icon-save',
    iconCls: 'icon-add'
    ...

    How are the image links constructed?
    Is there a way to override this?
    Where should I look to modify / add my own code?

    Thank you,

    Olivier Pons

  2. Sorry it's a mistake, I've based my code on a sample that was using its own css with images that are in the folder "examples/writer/images/".

    So I've just add this "custom" CSS file, moved the images to the right folder and now everything works fine.

  3. #2
    Sencha User olivierpons's Avatar
    Join Date
    Dec 2009
    Location
    Aix en Provence,France
    Posts
    116
    Answers
    6
    Vote Rating
    1
    olivierpons is on a distinguished road

      0  

    Wink


    Sorry it's a mistake, I've based my code on a sample that was using its own css with images that are in the folder "examples/writer/images/".

    So I've just add this "custom" CSS file, moved the images to the right folder and now everything works fine.

Tags for this Thread