sub menu drop down content...

User 78051 Photo


Registered User
199 posts

Hi guys

Have come across an issue in MB for which Adam has said there isnt a fix for yet which I am trying to work out a workaround for.

Basically, on a drop down sub menu if you set the width to 100% with padding, content overflows the background as you can see in this example http://notjusttalking.co.uk.cp-15.webhostbox.net/ - if you hover over 'publications' you will see that they have got really long nav points. (I appreciate that these nav points are pretty horrible but its dynamic and the client is in 'control' but even if they were shorter, the same would be happening.)

What I am trying to see is if anyone may have had this issue (seeing as it is a known issue with the software) and come up with a workaround to fix it 'til CC is able to update with a fix?

In the case of the above, would setting a fixed width on the drop down and making it a block element so that a long nav point 'gracefully' drops onto a second line and maintain padding on the left and right?

If this would work, how would I achieve it? If it wouldnt work, is there something else that might?

Thanks for any and all input
User 187934 Photo


Senior Advisor
18,666 posts
Online Now

How about using some php to count the number of characters and applying a style rule based on that?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
https://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
https://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 78051 Photo


Registered User
199 posts

Tahnks for the response Eric but this happens regardless of the size unless a fixed width is used - and if a fixed width is used, the content, if larger, will do exactly as in my original post (and worse)
User 187934 Photo


Senior Advisor
18,666 posts
Online Now

Since the content is dynamic you know where it's coming from. Count the number of characters in the content in the variable and apply the needed styling. I do this in a script now that converts a full view to a mobile view by counting and applying a style rule.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
https://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
https://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 78051 Photo


Registered User
199 posts

but the problem is the styling rule... thats what I am trying to get to the bottom of
User 187934 Photo


Senior Advisor
18,666 posts
Online Now

I'm not sure of you exact data but this should help get you going in the correct direction
Now all you need to do is to get the link class with it's number into you link text script.
<?php
$query = $pdo->prepare("SELECT linktext,CHAR_LENGTH(linktext) AS 'length_of_link' FROM mytable WHERE links =:links");
$data = array(
':links' => $links
);
$query->execute($data);
echo '<style>';
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $row) {
echo '.link'.$row['length_of_link'].'{';
echo 'width:'.$row['length_of_link'].'px;';
echo'}';
}
echo '</style>';
?>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
https://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
https://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 78051 Photo


Registered User
199 posts

Hi Eric

Really appreciate your input and advice but, I am probably being really thick, I dont see how that helps me?

Thanks

Jamie
User 187934 Photo


Senior Advisor
18,666 posts
Online Now

The script allows you to set the width according to how many characters are in the variable. You can adjust to percent if needed. You could also use it to adjust a number of things link margins or padding. I figured if your content is dynamic then you must have that as a variable.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
https://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
https://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 78051 Photo


Registered User
199 posts

I get that but I dont see how that helps when the navigation point is horribly large nor how it accomodates for the 'overspill' on the rhs of the dropdown which happens whether its a relatively small navigation point or an horrendous one.
User 187934 Photo


Senior Advisor
18,666 posts
Online Now

So what you really need to do is tell your client to reduce there content.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
https://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
https://progrower.coffeecup.com/shop/
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.