Jump to content

Resolved - Way to Set Product name length


jmartca

Recommended Posts

I have made this modification in the Kurouto skin
 
 
main.php line 53
<li><a href="{$crumb.url}">{substr($crumb.title,0,100)}</a></li>
that limit the number of char to 100 in the bar "where you are" or call it "adress bar"
 
If that can help someone
 
 
 
But I would like to suggest a option so I can change that in the admin panel like the product description short have it
 
thx
J-Marc
Link to comment
Share on other sites

the line of code cut only the display text and this is what I need, so I use that because my item title are very long

 

I make a topic about that only for other user need this....

 

by the way do you know where I can get a list of all $var declare in Cubecart 

 

ex:

$product.url =  Url of the current product

$product.name = name of the current product

$product.price = ....

 

 

I find something about what the file and where they are use but nothing about $var

 

https://support.cubecart.com/index.php?/Knowledgebase/Article/View/202/46/how-do-i-create-a-custom-skin-or-template-in-cubecart-v5

 

 

About BS is probably my computer I reboot it and every thing work so I will edit my msg to take it off

Link to comment
Share on other sites

thx for the advice I look for that and here what I find

 

http://blog.powermapper.com/blog/post/Page-Title-Length-for-Search-Engines.aspx

  • W3C recommends a maximum of 64 characters for page titles.
  • Bing recommends a title around 65 characters long.
  • Yahoo recommends a maximum title length of 67 characters (although this advice is obsolete since Bing now supplies Yahoo's search results) 
  • Google don't have any guidance for content publishers, and now limits the title on the visible (typographic) width displayed in the browser. For example, both these titles are 41 characters long, but one is much wider when displayed in a browser:
Link to comment
Share on other sites

Here what I have also done:

 

in main.php line 4 of Kurouto skin

{substr( $META_TITLE, 0 , strrpos( substr( $META_TITLE , 0 , 66 ) ,' ' ))} 

I put 66 because the smallest word after the the first cut will be one letter so:

66 char minus 1 letter minus one space I got the value of 64, so the magic value of the W3C and if we add "- (the powered by cube cart)" we got 88 char so is a more than what Goolgle ask for but I'm ok whit that

 

I have also made a other tweak about the number image display for one product now I got two column for a max of ten well displayed

Link to comment
Share on other sites

I've always thought it would be nice to have a special css style for the Product Title when you're creating a product listing that showed the box in the correct length to begin with.

 

We paid for the copyright removal key - so I assume that's why I don't see the "powered by cube cart" wordage on our websites that you describe.

Link to comment
Share on other sites

something like that? in HTML5

 

<input name="name" id="name" class="textbox required" type="text"  pattern="[ -ÿ]{4,60}" title="Pls enter a minimum of 4 characteres and a maximum of 60 that for a better seo optimisation">

 

in fact the title attribute should be a test var...

Link to comment
Share on other sites

Well, I'm the only one who inputs products, and I know to keep the title as SEO concise as possible. What I meant would be to actually create the text box itself to be exactly the maximum length I want. As it it, as the title gets longer the characters begin to scroll in the text box. It would be much easier to tweak a title if the whole thing showed at once.

Link to comment
Share on other sites

the problem is when you put a lenght "size attribute" for text input every browser manage it a bit differently ex:

 

http://stackoverflow.com/questions/5361606/input-fields-rendered-very-differently-in-different-browsers

 

the answering guy say "Different browsers use different default fonts, font sizes, and ppi measures, meaning that you get massively different sized (in pixels) fields."

 

but my experience is, set it to what ever exemple 25 and in some browser it will fit exactly 25 char and after it will scroll but in other you will be able to fit almost 50 before you reach the end so I really dont know what to do whit that except make a big css whit exception for each browser and the good value for each of them after test it all or just test Chrome and for the rest .... put a text box pls. use Chrome... ok you can do it for FF too...

 

best regards,

J-Marc

Link to comment
Share on other sites

Since I'm the only one who inputs, and I use FireFox, I really only need to be satisfied with the way it looks in FF. As one of the commenters on your link said, people only look at one browser at a time normally and won't notice that it's different on another browser.

 

So I suspect I could create a rule for just this textbox with the size attribute that works for me. Deciding what length is the equivalent of x number of characters is the part I don't get.

Link to comment
Share on other sites

ok it should work

 

so font have different lenght ex:

 

10x "L" in small

llllllllll

 

Versus 

 

10x "M" in caps

MMMMMMMMMM

 

that some of the worst case but it's just to show it's dificult to manage a displayed limitation BUT if you use a fixed length font that will work great I just try it a few minute agos

 

so here how to do that

store/admin/skins/default/styles/layout.css

line 285

look like

.tab_content input.textbox, .tb-form input.textbox {
    width: 300px;
}

change it to fixedsys have a fixe characteres width so a I will be egual to a W in this font but this font is only in MS windows as I know for you rinformation they call those type of font "monospaced font"

.tab_content input.textbox, .tb-form input.textbox {
width: 300px;
}
.tab_content input.textbox#name {
    font-family: Fixedsys;
    width: auto;
}

 

that will make the font inside the text box to the font "fixedsys" so now if you use the attribute " size="25" " only in product name

 

than

 

into the products.index.php of store/admin/skins/default/templates/ line 127 look like

	  <div><label for="name">{$LANG.catalogue.product_name}</label><span><input name="name" id="name" class="textbox required" type="text" value="{$PRODUCT.name}" /></span></div>

so add a attribute size="here the number of char" in my exemple 40

	  <div><label for="name">{$LANG.catalogue.product_name}</label><span><input name="name" id="name" class="textbox required" type="text" size="40" value="{$PRODUCT.name}" /></span></div>

that work in FF and Chrome except Chrome add 1 char for the luck :) so in Chrome 40 give you a 41 char long box

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...