PDA

View Full Version : How to change the comma in category?



Wei Hong
December 24, 2015, 01:17 PM
Dear Flynax Dev.,

How to I change the comma(',') that separates sub cat (DVD, Other Formats, VHS) show in the picture, to another sign, for example "|"
1528

I have looked into the category.tpl and category_block.tpl but can't find anything.
Please advice

And merry xmas to you too.

Wei Hong
December 27, 2015, 01:43 PM
UP for a new week.

Pete Young
December 27, 2015, 11:43 PM
http://yoursite.com/templates/general_simple_blue/css/style.css

go to your syle.css (line 208??) and look for this

.sub_categories {
padding: 9px 20px 0 0;
color: #654234;

ad change it to this / below, this will white out the back ground and make it disapear and leave the correct gap ( add colour code to suit your background / use a colour picker in tolls if not sure)

.sub_categories {
padding: 9px 20px 0 0;
color: #ffffff;

Wei Hong
December 28, 2015, 03:16 AM
http://yoursite.com/templates/general_simple_blue/css/style.css

go to your syle.css (line 208??) and look for this

.sub_categories {
padding: 9px 20px 0 0;
color: #654234;

ad change it to this / below, this will white out the back ground and make it disapear and leave the correct gap ( add colour code to suit your background / use a colour picker in tolls if not sure)

.sub_categories {
padding: 9px 20px 0 0;
color: #ffffff;

Hi Pete,

Thank you so much for your suggestion. But I'm planning to change the comma ',' to another sign like '|' or may be '<br/>' so each sub will be on 1 line only. I thought I could change it in category_block.tpl but no luck. I dont think changing in css could make the change with <br/> though. But I appreciate your help.

Alex
December 28, 2015, 04:53 AM
Hello,

Insert the following code below into your Admin Panel > Database

INSERT INTO `{sql_prefix}config` (`Group_ID`, `Position`, `Key`, `Default`, `Values`, `Type`, `Data_type`, `Plugin`) VALUES
(1, 55, 'subcategory_divider', ',', '', 'text', '', '');


INSERT INTO `{sql_prefix}lang_keys` (`Code`, `Module`, `Key`, `Value`, `Plugin`, `Status`) VALUES
('en', 'admin', 'config+name+subcategory_divider', 'Subcategory divider', '', 'active');


Result of this code lines: (Admin Panel > Configurations >> General)
http://forum.flynax.com/images/attach/flynax/28-12-15/subcategories_divider.png

Next stage: using the config in template.

Go to your template files: /tpl/blocks/categories_block.tpl

Find something like this:
http://forum.flynax.com/images/attach/flynax/28-12-15/categories_block_tpl_before.png

and replace to:
http://forum.flynax.com/images/attach/flynax/28-12-15/categories_block_tpl_after.png

Save and close this file.
It's done.

Wei Hong
December 28, 2015, 05:30 AM
Hi Alex,

Thank you so much for reaching out for us. But you forgot to attach the file. When you say

"Find something like this:

and replace to:

"
It's blank, I cant see what did you put in there. Would you please revise
Thank you

Alex
December 28, 2015, 05:58 AM
I'm sorry for that, the post (http://forum.flynax.com/showthread.php?2823-How-to-change-the-comma-in-category&p=13396&viewfull=1#post13396) has been updated.

Wei Hong
December 28, 2015, 06:13 AM
I'm sorry for that, the post (http://forum.flynax.com/showthread.php?2823-How-to-change-the-comma-in-category&p=13396&viewfull=1#post13396) has been updated.

Hi Alex,

Thank you so much for your fast response. I however couldn't find the code that you suggest to change. Please check my categories_block.tpl file. I'm using general_wide template.
https://app.box.com/s/2setbvrdhxs8d634p2m4fp1f81l9itx5

Alex
December 28, 2015, 07:07 AM
For *_wide templates the separator in CSS [style.css] (as said Pete)

http://forum.flynax.com/images/attach/flynax/28-12-15/subcategories_separator_css.png

Change the content value to as you like.

Wei Hong
December 28, 2015, 07:24 AM
For *_wide templates the separator in CSS [style.css] (as said Pete)

http://forum.flynax.com/images/attach/flynax/28-12-15/subcategories_separator_css.png

Change the content value to as you like.

Ah how careless of me for not seeing it. I have looked into it and turn out Pete was right. My bad.
So would it be possible if I want to use <br/>, to separate each sub in one line?

Alex
December 28, 2015, 07:34 AM
Try to use \A instead of <br/>

P.S. Refresh your browser cache after this changes.

Wei Hong
December 28, 2015, 07:49 AM
Try to use \A instead of <br/>

P.S. Refresh your browser cache after this changes.

Hi Alex, I tried it :


.categories .sub_categories > span:not(:last-child) {
padding: 0 0 2px 0;
display: inline-block;
}
.categories .sub_categories > span:not(:last-of-type):after {
content: '\A';
padding-right: 5px;
}
.other_categories_tmp > div > span {
padding: 0 0 2px 0;
display: block;
}

Still nothing happened. :( hu hu

Alex
December 28, 2015, 09:22 AM
ok, than remove the content: '\A'; (or comment)
Go to your .tpl file: /tpl/blocks/categories_block.tpl

Go to line~: 58
Put the code like on screenshot below: {$config.subcategory_divider}
http://forum.flynax.com/images/attach/flynax/28-12-15/subcategories_wide.png

See attached file. (it's a your file with the customizations above)

Wei Hong
December 28, 2015, 10:47 AM
Look perfectly thanks to Alex.
Happy New Year to you and all the Flynax Staffs.

Sanjay Pattar
December 29, 2015, 02:09 PM
Hi Alex,

I had same requirement, I wanted each sub category to be on next line, i tired above code but didnt work.

Dont know where am going wrong.