At least I think it's pane.header.

My client has asked if they can add a line or two of text between the title and the tree/directory panes. Something like "Use the online resource area to blah blah diddly doo".

I'm a complete newbie to Drupal so I'm guessing that this is a simple thing to acheive. Any help massively appreciated.

Ta

Paul

CommentFileSizeAuthor
#10 webfm.zip28.94 KBpaul.dambra

Comments

paul.dambra’s picture

Version: 5.x-2.1 » 5.x-2.15
paul.dambra’s picture

Have achieved this using a "before"tag in the css.

Not sure that's a great solution since it feels like a hack.

Any better ideas?

ballerjones’s picture

If it worked, no worries. Could you post the code? thanks

Also: does it work in IE?

paul.dambra’s picture

Code used in CSS...

#webfm::before
{
font:italic 700 12px arial;
font-size:110%;
content: "This text appears below the title and above the folder and file display area";
}

/*
* This floats an image below the unexpanded tree display.
* The expanded tree hides the image.
*/
#webfm {
background: url("../some_image") no-repeat center left;
}

/*
* The client wanted colour. This repeats a tall thin gradient image across the page.
* Our implementation has an image that fades in from white to a light blue bottom
*/
#squeeze{
background-image: url("../some_tall_thin_image");
background-repeat: repeat-x;
background-position:bottom;
}

I've tested this in IE7 and 8, Chrome and Firefox.

ballerjones’s picture

Thanks for the post. Strange that it works for your in IE7 (doesn't for me). According to this: https://developer.mozilla.org/en/CSS/:before

It only works in IE8 and according to another source, not even IE8 supports images in :before elements.

You may have already tried this but do you know if there's a way to modify the module so that there can be a div in the location of our newly added text? This way, HTML can be added instead of simply text. Also, this would solve the browser compatibility issue.

paul.dambra’s picture

Just checked again and you're right IE7 doesn't display the text... was all done rather speedily so I probably checked on IE8 twice by accident. I'm not too concerned since it fails gracefully rather than messing the page up *and* because I recognise this as an imperfect hack and not a solution.

I imagine it is possible to alter the module I wouldn't even know where to begin though. Any pointers would be appreciated...

ballerjones’s picture

I've asked all around but to no avail. I think it has something to do with the lack of a template file for the main view. However, an oft spoken about views integration could do the trick. That is, if they decide to have one for V6.

paul.dambra’s picture

So the baby went to bed earlier than expected yesterday and I grabbed some time to think.

I removed my before hack from the CSS and added #toptext{margin-left:20%;}

Then I added at line 460 in webfm.js

//my hack to add text above squeeze div
//html string to add
	var newHTML = "<h3 text-align=\"right\"><em>This area allows access to files and resources provided by AfSL. It works similarly to the file explorer on your computer. <br>You will need to register and contact AfSL to be assigned permissions in order to see some content.</em></h3>";
//get a reference to the squeeze div
       var squeezeDiv = Webfm.$('squeeze');
//create a new div
	var newDiv = Webfm.ce('div');
//and give it an ID for css
        newDiv.setAttribute('id','toptext');//css id
//insert the new DIV as the first child of squeeze
        squeezeDiv.insertBefore(newDiv,squeezeDiv.firstChild);
//now that the DIV is in the page use jQuery to set it's content.
	$("#toptext").html(newHTML); 
//end of hack

That puts it above the line webfmUploadAutoAttach(); in Webfm.commonInterface = function(parent) {}

That's using JQuery and the webfm create element helper so should be consistent between browsers. I've got firefox 3.something, Chrome 2 and IE8 on this machine. and it works on all three.

This seems less hacky to me. If I get time I'll look at how the admin menu is created and try to add a way to set the text with that but while I can write java, vb and c# I'm a fish out of water with php...

P

ballerjones’s picture

Would you mind posting your webfm module (as a zip file or something), or maybe as a patch? I tried applying your fix but, for some reason, it creates this: http://internal.lomira.k12.wi.us/screener2.bmp

Somehow, the left window is gone, and the files are too. I placed the js before that line you mentioned just as you had instructed.

If you can post it as a patch (especially with the admin screen feature), that would help the community a lot I'm sure. This seems to be the way experts post their helpful contributions.

paul.dambra’s picture

StatusFileSize
new28.94 KB

Hey, here are my two edits. The rest of the module is exactly as v5.x-2.15 is downloaded so if you've got a different version or other edits then you'll need to amend my code to take that into account.

This is live at http://www.afsl.org.uk/webfm so you could take a look at that page source to see what is different to your site?? If anything obviously.

I'd be happy to submit as a patch if I knew how :-)

paul.dambra’s picture

There are definitely different CSS files applied to your site than to mine so...

paul.dambra’s picture

Hmmm, would this help you?

http://drupal.org/node/311991

ballerjones’s picture

Your fix didn't work, but I just realized we are using different versions of the module. I'm using Drupal 6.

Anyway, your link was extremely helpful. After a few minutes and some CSS workarounds, I finally was able to get webfm looking like I want it: http://internal.lomira.k12.wi.us/screener.jpg

Thanks again.

paul.dambra’s picture

Status: Active » Closed (won't fix)

Didn't realise this was still open. I've marked as won't fix since I found a workaround