drjun1994 2014-10-26 21:59
浏览 38

龙门模板扩展中的较少解析错误

There is an interesting article on how to extend the Joomla Gantry template to allow for text logos. Here is the URL:

http://www.tkstudiodesign.com/articles/gantry-framework/item/27-text-logo-site-slogan

I followed the instructions to the best of my understanding. I created a feature file which I called textlogo.php, I added the two variables to the styledeclaration.php file where the author said I should add them, and I created another file containing the last piece of code in the article which I called textlogo.less. The only problem I had was with the custom styling classes (3rd piece of coding in the article) which I didn't know exactly where to place so I placed them in my custom CSS file in Gantry. I compiled the textlogo.less file to generate CSS code and cleared the gantry cache at the end. However, I still get the following error:

Error: 0 - Less Parse Error: failed to parse passed in variable @logotext_textcolor:

This variable, BTW, is one of the two variables added to the styledeclaration.php file as mentioned above.

I only applied minimal changes to the code, modifying some variable names slightly to reflect my website as well as the text to be displayed.

My website is now down because of the error and the only way to bring it back up would be to delete all the changes and files I added. I don't want to do that for the time being since it took me a long time of painstaking entering and deleting trying to solve little problems along the way, and my editor doesn't allow for cut and paste.

So if anybody can help with this matter, I would appreciate it greatly.

Best regards to all.

Further Note:

Thanks to Bass Jobsen for pointing out the possibility of a typo in styledeclaration.php. Here is the part of the file that I added 2 variables to:

30 // Colors

31 $lessVariables = array(

32 'logotext_textcolor' => $gantry->get('textlogo-sacs_logo_textcolor'),

33 'logotext_hover_textcolor' => $gantry->get('textlogo-sacs_logo_hover_textcolor'),

34 'linkcolor' => $gantry->get('linkcolor', '#2698de'),

35 'headerstyle' => $gantry->get('headerstyle', 'dark')

36 );

The first two variables (lines 32 and 33) I added myself. The other two are original to the template. I would have liked to show a picture of the file but I cannot post images as I am still new here without enough reputation. I hope this helps.

Furthermore, the following is the textlogo.css file generated from the compilation of the textlogo.less file. I also noticed that while the original less file had a reference to the variable in question, the generated css file does not: there is no value for "color:" after the colon. That could be due to failure to parse: there is no value to return. Anyway, here is the file:

1 .sacs-text-logo {

2 padding: 0;

3 margin-top: 7px;

4 line-height: 35px;

5 vertical-align: middle;

6 }

7 .sacs-text-logo a.sa-rt-logo {

8 font-size: 20px;

9 color: ;

10 }

11 .sacs-text-logo a.sa-rt-logo:@hover {

12 color: !important;

13 }

14

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 做数电题要具体的步骤
    • ¥20 PDF元数据中的XMP媒体管理属性
    • ¥15 R语言中lasso回归报错
    • ¥15 网站突然不能访问了,上午还好好的
    • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
    • ¥15 semrush,SEO,内嵌网站,api
    • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
    • ¥15 振荡电路,ADS仿真
    • ¥15 关于#c语言#的问题,请各位专家解答!
    • ¥15 这个如何解决详细步骤