[EP-tech] icons for form button "new item"

Tomasz Neugebauer Tomasz.Neugebauer at concordia.ca
Fri Sep 18 22:34:59 BST 2020


Thank you David, that approach worked!  I added an SVG icon to the button.
My CSS ended up like this:

input[name="_action_create"] {
    background-position-x: 4px;
    background-position-y: 3px;
    background-size: 15px;
    background-image: url(/style/images/Iconnewitem.svg);
    background-repeat: no-repeat;
    padding-left: 26px;
}

Tomasz


From: David R Newman <drn at ecs.soton.ac.uk>
Sent: September 17, 2020 6:48 PM
To: eprints-tech at ecs.soton.ac.uk; Tomasz Neugebauer <Tomasz.Neugebauer at concordia.ca>
Subject: Re: [EP-tech] icons for form button "new item"




Hi Tomasz,

You could try something like this is the CSS:

input[name="_action_create"] {
        background-image: url(/style/images/help.png);
        background-repeat: no-repeat;
        background-position: 8px 4px;
}

There are a couple of potential issues.  That CSS will apply to any other buttons with the name "_action_create" but I don't think there are many iif any other places where this is used.  The other problem os that as this icon is in the background and the text is set via the phrase the text may overlap the icon so you may need to hack around with the width of the input button to fix this and/or make it look more aesthetically pleasing.

Regards

David Newman
On 17/09/2020 23:09, Tomasz Neugebauer via Eprints-tech wrote:
This is a really basic question in a way, so I am thinking that others may have found a solution already.
We have phrases in EPrints, for customization, but has anyone been able to add an icon/image to some of the most important buttons.
The button that is perhaps the most important for OA is the "New Item" button that appears for users after they log in.
I think we would want that button to stand out, and adding an icon to it would help in that regard.
How would I do that?
Normally, I would do it with a piece of code like this, for example: <i class="fa fa-file-text-o" aria-hidden="true"></i>
Which, combined with some CSS gets me an icon.
However, the only place that I see in EPrints to make this change would be in the phrases, this one:
<epp:phrase id="Plugin/Screen/NewEPrint:action:create:title">New Item</epp:phrase>
And that string makes its way to a "value" parameter inside a form, which means I can't add any markup to get the icon.

Tomasz




*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech

*** Archive: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=gcE0dzSwIGlmKhNUNd2XMb6246omwEiRp1DBPN0PVyM%3D&amp;reserved=0

*** EPrints community wiki: https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=V2oYbUHzh%2FLeKhBRoFUgFhyDgAv9gNz0l1xXiYEKCzg%3D&amp;reserved=0

[https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fipmcdn.avast.com%2Fimages%2Ficons%2Ficon-envelope-tick-green-avg-v1.png&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=NUbYKeaskdiLbvp35Vk5vdoC5iDEutjoYOgqlErHTkw%3D&amp;reserved=0]<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=WTM4NvJHq%2BpZj3Kvhdm1De9J%2BxVX4NTogFy8ucntTJw%3D&amp;reserved=0>
Virus-free. https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2F&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=a1N5m2cwRUxEMITkLtfN8KzWECCH8SOWLIxYrlJ8YB8%3D&amp;reserved=0<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.avg.com%2Femail-signature%3Futm_medium%3Demail%26utm_source%3Dlink%26utm_campaign%3Dsig-email%26utm_content%3Demailclient&amp;data=01%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C2e4dc7db5e9e4655646908d85c1ab3e6%7C4a5378f929f44d3ebe89669d03ada9d8%7C0&amp;sdata=WTM4NvJHq%2BpZj3Kvhdm1De9J%2BxVX4NTogFy8ucntTJw%3D&amp;reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20200918/53b4d313/attachment-0001.html 


More information about the Eprints-tech mailing list