Hello~
I created a view which was working great but I wanted to change the name of it to something that more accurately reflects what it does. I didn't know how to do this except for cloning the view and giving it a different name, then deleting the old view. This worked fine except now the block is being given some randomly generated string for it's id (id="block-views-6afc54f4df9bf9a3666f2387918fac28") whereas before it gave it a more meaningful id that included the name of the view. I'd rather not write up my style sheet with a selector that has this in it. Is there something I'm doing wrong or some setting that I'm missing?

Comments

pontus_nilsson’s picture

I had the same problem once, I believe it happened when my views name was too long. Try shortening down your views name.

t_durden’s picture

That was it! Thanks!

CatherineOmega’s picture

Thanks for this! I just ran into this weird block ID problem and wondered if it might have been because of the kind of content or because I'd cloned a view. Nope, this is it...my question is, is this really a good thing? Should Views give some kind of caution: "wow, that's a pretty long name, don't you think? Bad stuff might happen, you know."

RotHorseKid’s picture

Thanks a lot. We just banged our heads on that one for two hours. This should be in the views docs.

Saoirse1916’s picture

Evidently "multimedia_photo_galleries" is too long. Good catch, glad I found this thread!

jfarry’s picture

I've just recently had this problem and originally thought it was just the block id (the machine name that you can set in the view, under "Advanced") being too long that's the problem, but it looks like the character restriction is on the entire id. The entire id for the block is made up of the view id PLUS the block id.

E.g: Taking the block ID #events_and_calendars-mini_cal events_and_calendars is the view id and mini_cal is the block id. If the view id were to be something like #events_and_calendarsxxxxxxxxx and then you try to append mini_cal to the end, it would produce the same random string effect.

polishyourimage’s picture

does anyone know what the exact character limit is?

widukind’s picture

The limit is 32 characters, apparently due to the VARCHAR(32) data-type used for the "delta" field on the "block" table.

Add the char length of your View's machine name to the View-display's machine name, then add one for the delimiting dash.

In other words, the string length of "[View machine name]-[View-display machine name]" should be less or equal to 32.

loopy1492’s picture

The sure-fire way to not have a problem with this is to just create a unique CSS class for this view and use that as a selector for CSS and Javascript instead, if that's possible in the scope of the solution you're looking for. You'll have to do some child -> parent selecting, though, which I guess is kind of annoying.

sassafrass’s picture

Thank-you!!

Lynn Haas