how to use resource Images in mvc view - asp.net-mvc-5

I'm following this blog, every thing is fine. But i have a issue how to handle Resources Resx Image or calling by view.Here is my code snippet
<img src=#Resources.mODIFYGUIDLINE class="map img-responsive" alt="Hajj MAp" width="1136" height="600" />

Name of the [string] along with [Image name].extension
<img src="~/[foldername]/#Resources.[string name]" class="map img-responsive" alt="Hajj MAp" width="1136" height="600">

Related

Added images in product attribute in WYSIWYG not showing in frontend

We're working with Magento 2.2.8, we added product attribute using WYSIWYG editor in admin panel. Image is showing perfect with admin url.
<img src="{{media url=" wysiwyg="" u4888.png"}}"="" width="400" height="400">
But, in product detail page, it's not showing image. It seems like media is not rendering.
Please check below code, the media url is not changing to dynamic url as its doing in admin.
<div class="col-md-4 custom-accordion__col">
<img src="{{media url=" wysiwyg="" u4888.png"}}"="" width="400" height="400">
</div>
Your help is highly appreciated.
Thanks,
Saikat
Whenever I add an image using WYSIWYG, the output I usually see looks something like this:
<img src="{{media url="wysiwyg/folder/image.png"}}" alt="" />
In your case, if the image is uploaded using WYSIWYG, the URL should look like this:
<img src="{{media url="wysiwyg/u4888.png"}}" width="400" height="400">
Hope this helps!
I just found the solution. So, in display block section we have to put below codes:
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
<?=$_helper->productAttribute($_product, $product->getData('quality_n_materials'), 'quality_n_materials') ?>
Thanks,
Saikat

How to send property values to svg files using ember-inline-svg?

I am using ember-inline-svg, there is a logo.svg file, I'm calling it with
{{inline-svg 'logo' class="logo" }}
in my hbs file.
It works fine. I just need to send one more data param to it and access that in the svg file so that I can dynamically generate svgs. How would I go about doing that?
what you want is not possible, because svg itself has no dynamic parts.
however you probably don't need ember-inline-svg at all. Could it be a possibility to put your svg inline into a component?
Just create a component Logo and put the svg inside the logo.hbs:
<svg height="60" width="200" ...attributes>
<text y=20 >I love {{#name}}</text>
</svg>
Then set tagName: '' (or use a template-only-glimmer-component). Then you can just use it as a component:
<Logo class="logo" #name="Ember" />

Orchard Recipe Add Page - Image Base Url

I am trying to add a page (homepage) in an orchard recipe that contains an image in HTML. However, the full URL of the image is dependent upon the deployment.
How can I use the base URL of the site in the recipe?
So far I've got this:
<Data>
<Page Id="/alias=" Status="Published">
<BodyPart Text="<p><img alt="" src="~/Media/Default/Page/Homepage.png" width="100%" /></p>" />
<CommonPart Owner="/User.UserName=admin" />
<AutoroutePart Alias="/" CustomPattern="/" UseCustomPattern="true" />
<TitlePart Title="Home" />
</Page>
</Data>
But the normal ~ doesn't resolve to the base url.
Ideas?
Recipes don't support tokens or dynamic values, but that would definitely be a nice feature.
For now you will either have to implement such functionality yourself, or you could leave the url as is (starting with the tilde), and implement an IHtmlFilter that will actually process relative values at runtime.

Text box creates gap when floated left in IE7

I've got a left rounded corner box -> textbox -> right rounded corner box which all make up part of a search box. All's well in FF, Chrome, IE8 but not IE7.
I've checked it using the debug tool and and I have tried a number of options, none of which want to work at the moment, so I am hoping someone might know what this issue (bug) might be please?
Here's a snippet of my code:
<div class="roundBox4">
<img src="../App_Themes/MyChoice2010/Images/reality-box-top.gif" width="228" height="8" /><img
src="../App_Themes/MyChoice2010/Images/reality-box-locate.gif" width="228" height="49" />
<asp:ContentPlaceHolder ID="Box4Content" runat="server">
</asp:ContentPlaceHolder>
<div class="locateABroker">
<img src="../App_Themes/MyChoice2010/Images/locate-broker-left.gif" class="locateBrokerLeft"
height="19" width="3" /><asp:TextBox ID="TextBox1" CssClass="locateBrokerCenter"
runat="server"></asp:TextBox><img src="../App_Themes/MyChoice2010/Images/locate-broker-right.gif"
height="19" width="3" class="locateBrokerRight" />
Submit<img src="../App_Themes/MyChoice2010/Images/box-arrow.gif"
class="linkArrow" width="8" height="14" />
</div>
The only thing that I can say about IE7 is that you almost literally need to declare everything in your CSS. Inheiretance is abysmal in IE7. I would make sure that you are a) using a good reset.css and b) try declaring any padding, etc. directly on the element that is giving you issues.

help with Watir for automated testing a webapp

I m using Watir for automated testing a webapp.
In one of the page i have something like htis
</STYLE></HEAD><BODY background="IMAGES/fon06.gif"><DIV class="mainalignment" height="110%" width="110%"><TABLE class="mainframe" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"><TBODY><TR><TD><DIV id="divTabButtons"><P align="left"> <INPUT class="tabOff" id="1" onclick="tabOnClick(1)" type="button" value="TIMESHEET" /> </P></DIV></TD></TR></TBODY></TABLE></DIV></BODY></HTML>
But m able to identify the HTML element to access it.
I need to access the id="1" value="TIMESHEET" element.
How do I do it in Watir.
If more info is required pls let me know.
Note: I am a HTML noob.
EDIT: I tried showAllObjects to see whether the objects are displayed or not.
and this is what I got
-----------Objects in page -------------
HTML Document name=header id= src=header.jsp
HTML Document name=body id= src=body.jsp
This is very strange.
but When i look at the page..there are many objects..
I m confused now..
If you want to click the button, any of these will work:
browser.button(:id, "1").click
browser.button(:value, "TIMESHEET").click
browser.button(:id => "1", :value => "TIMESHEET").click
More information at http://wiki.openqa.org/display/WTR/Buttons and http://wiki.openqa.org/display/WTR/Multiple+Attributes
If you want to check first, you can do this:
if browser.button(:id, "1").exists?
browser.button(:id, "1").click

Resources