I've created a custom layout in the user interface, not in a module. Works great. Any way to change the default icon? It defaults to the flexible png icon, but I'd like to change the icon to reflect what my layout looks like. Is there any way to easily do this? Thanks for any direction.

Comments

merlinofchaos’s picture

Title: Default icon for layout » Set a new icon for saved flexible layout
Category: support » feature

Right now flexible layouts all use the flexible layout icon.

Creating a new icon would be a little tricky, because these layouts can be exported and it's very difficult to export an icon. It's not impossible but has to be handled carefully.

Changing to a feature request.

merlinofchaos’s picture

I don't think that's dumb, it makes sense that you did that and didn't get the result you expected. I'll keep this in mind in the future when thinking about ways to make the UI better. Thanks for the feedback, this is valuable.

merlinofchaos’s picture

Whoops. Ignore #2, posted that on wrong issue.

jenlampton’s picture

I've had several classes all point out that the flexible layout icon doesn't look like the layout created.

I think it would be better to use an icon that showed no layout at all, than to use one that shows an incorrect layout. Can we have one with just the word "CUSTOM" or "FLEXIBLE" or something very visually different at first glance - as an indicator to read the layout name instead of relying on the icon to choose from layouts available?

fbo’s picture

Yup, first thing my client said was also: "but... they are all the same!",
I'd be quite content with exporting/importing and editing the array - would not necessarily need a UI.

Alternatively the href could get the layout name as class and it can be done in css.

Hm, shouldn't I be able to do something with form_alter or somesuch?

jenlampton’s picture

@fbo if you are comfortable with code you might consider writing your own panels layouts. You can define your own .tpl.php file, your own style sheet, AND your own icon :) Plus - there's a huge performance gain!

This is all really well documented inside the panels module. See panels/help/plugin-layout.html. Or, check the existing layouts in panels/plugins/layouts.

My complaint was on behalf of the people who may be hopeless with HTML, CSS, or terrified of writing their own modules or themes with custom panels plugins.

tmsimont’s picture

perhaps there could be some kind of theme folder name-based convention for an icon override.. like path_to_theme()./ panels-layout-icon-layout_name.png..

it does confuse clients when they see all of the layout thumbnails looking the same..

also, there's not classes on the form, so you can't fix it with CSS :(

and also no hook_form_alter.. because it's not even a form...

:(

merlinofchaos’s picture

The problem here is that right now, there's no way to export images. At least if I try to autogenerate the image, that'd be doable. Of course, autogenerating an image based on a panel layout is a not insiginficant amount of code to write. Compared to my other priorities, it doesn't rate. Though it does seem fun enough I may give it a go sometime when I should be doing something else.

AS for uploading the images, maybe if I uuencode them and serve them up directly. That seems...pretty exciting to do. And would potentially really bloat code for exported layouts.

merlinofchaos’s picture

As for a better default icon, please, give me an icon. Icon making is NOT among my skills. All of the icons Panels uses were contributed.

tmsimont’s picture

but do you really need to export the image?

it would be cool, but if we're talking about appearance then I'd think the theme would be the place to make changes, either with a css override (hide image, put background image) or some kind of naming convention image file.

you could export a comment in the code ( /** theme may contain overrides **/)

I think the biggest problem with it now is that there is simply no way at all to change the image.

Even a more specific css class, that uses the name of the layout ( which is already forced to be CSS friendly ), could really make it customizable...

fbo’s picture

@jenlampton yes I should - just being lazy. Mainly because I anticipate a lot of layout requests and would like to unload that on the future webmaster (who is "hopeless with HTML, CSS, or terrified of writing their own modules or themes").
Neat would be if the exports could just be shoved into their own .tpl.php without (much) editing.

jenlampton’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

bumping up to 7.x for more eyes :)

japerry’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.