Custom Skin Enhancement

alt=
@anandpd
12 years ago
5 posts
Hi,
I am enhancing a custom skin for Jamroom5. I have few queries. Can somebody help me out?
I am newbie, so please let me know if there are some old thread related to these

1. When I add extra js or css files in skins/XYZ/css or skins/XYZ/js folder, they do not get automatically added.
As I see in meta.tpl file, there are few if blocks to include css/js files. They are like javascript_embed/javascript_href.
How to modify those to take additional (new) files I have added in above folders?

2. Is there ian default jQuery library used? How to change it?

3. There can be multiple css files in skins/XYZ/css folder. There is chance to overlap some styles like for "body".
Now if I want to redefine body style using new css file, how can I do that? Change existing file? (risk of impacting other pages). If I just add my css file, how is it ensured that my style is used? All css files from css folder are included in header (through css_embed or css_href), so order may differ and the style of last included css file is enforced.

Can you please help me?
updated by @anandpd: 12/14/13 03:32:00PM
douglas
@douglas
12 years ago
2,804 posts
Hello,

1. You'll want to add the new css and js to the skins include file in the YourSkin_skin_init function and then run the integrity check tool to bring in the new files.

CSS entry example:
    jrCore_register_module_feature('jrCore','css','YourSkin','your_css_file.css');

JS entry example:
    jrCore_register_module_feature('jrCore','javascript','YourSkin','your_js_file.js');

2. Yes, I believe it is in the modules/jrCore/js folder its is jquery-1.8.3.min.js .

3. You'll want to change the existing file. We made sure that there are not duplications in the default CSS files and they have been separated to make things easier.

Hope this helps,
Douglas


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 11/13/13 09:00:49AM
alt=
@anandpd
12 years ago
5 posts
Hi Douglas,
Thank you for the response. It worked.
Now I am trying to find out how to invoke document.ready function. Through forum, I found that I need to include it in the module. ( http://archive.jamroom.net/phpBB2/viewtopic.php?t=42403&sid=dbf731a398d2d183369d822f1e2a83ad)

However if I have to invoke it only for certain page in the skin, how can I do that?
I am thinking to put the code snippet mentioned in the thread in the skins/XYZ/include.php. Is that "correct" way?

BTW, I added jrCore_register_module_feature in skins/XYZ/include.php (as there were few others as well). Is that the correct way?

Thanks & Regards
:-Anand
michael
@michael
12 years ago
7,799 posts
Doug's the man for skin development, FWIW, if your only invoking document.ready on specific pages, there's no reason you can't put it in the .tpl files of the pages that your using it on.
alt=
@anandpd
12 years ago
5 posts
Hi Michael,
I have added such, but it is not getting invoked.
There might be some stop on event propagation.

:-Anand
michael
@michael
12 years ago
7,799 posts
not that im aware of. Is the code getting output to the source?

If it isn't might need to clear the caches from the ACP or enable developer mode.

The other thing that could be making it not work would be a JS error earlier on in the code, so check firebug console for any javascript errors.
alt=
@anandpd
12 years ago
5 posts
Yes, the code is getting into source.
What is ACP? I have tried clearing cache on local browser.

There are 2 errors in firebug. They don't seem to be related, but now I need to investigate more. As all js files are embedded into one, it is difficult to track the error & that too from some minified js file.

:-Anand
alt=
@anandpd
12 years ago
5 posts
Hi Michael,
Your guess seems to be right. There is one error coming from one of the document ready function.
It is in setup function of stepcarousel.js. It is located in skins/XYZ/js. I have replaced it with newer version.
However the new js file is not getting reflected to source. Is there anything extra I need to do if I change any js file? You said about ACP. What was that?

:-Anand

P.S. There are some pointers on few forums about stepcarousel ( http://www.dynamicdrive.com/forums/archive/index.php/t-54164.html)
SteveX
SteveX
@ultrajam
12 years ago
2,584 posts
ACP is the Admin Control Panel.

Whilst developing, you would want to install the Developer module and turn on developer mode. That will cause the js and css to be rebuilt on every page load, slightly slower, but you need this if you are working on js or css files. Other wise the js is only rebuilt occasionally.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags