I have a html page in which there is a Link whose address is mentioned in AppSettings tag of web config
<appSettings>
<add key="MyAttribute" value="https://www.google.co.in/" />
</appSettings>
Html Code : [i need to do something like this]
<a href=" <%=ConfigurationManager.AppSettings("MyAttribute")%> " > fbm.wrdsreports.com</a>
Note : Above method does not work.Please be patient i am new to HTML.
Can any one suggest me how to do it.
Hi could you please try below..
fbm.wrdsreports.com
Related
I am trying to pass a French word from Controller to View using viewbag (The word that I try to pass is : Espèce), but inside the view when I try to affect the viewbag value's to an HTML input type text all I see is : Espéce .
In Controller
ViewBag.T = "Espèce";
In View : I used Jquery to affect the value
$("#T").val("#ViewBag.T").focus();
The HTML Input
<div>
<input type="type" id="T" value="" />
</div>
The result
Looks like an encoding issue. I'd recommend UTF-8 to ensure you get the accent marks to show up correctly.
From the Microsoft ASP.NET documentation:
To set the encoding for all pages, add a Globalization property to the
Web.config file, and then set its fileEncoding, requestEncoding, and
responseEncoding attributes, as shown in the following example:
<configuration>
<system.web>
<globalization
fileEncoding="utf-8"
requestEncoding="utf-8"
responseEncoding="utf-8"
culture="en-US"
uiCulture="de-DE"
/>
</system.web>
</configuration>
Try the below jquery code it will work as you expected. But it may introduce an XSS vulnerability. You can refer the link.
$("#T").val($("<div/>").html("#ViewBag.T").text()).focus();
I have installed a new extension having a block_featured_products.phtml file under folder inchoo/featuredproducts . I want to call this file in my index.phtml that is under cms folder.
Here which I tried after google search but not working:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('inchoo/featuredproducts/block_featured_products.phtml')->toHtml(); ?>
Where I am doing wrong?
Assuming inchoo/featuredproducts/block_featured_products.phtml exists, are you able to output anything from said file (clear contents and throw in some Lorem Ipsum, for example) when it's called?
Personally, I would recommend using XML (cms.xml, page.xml, or simply local.xml) to define your block and its template, like so:
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="content">
<block name="block_featured_products" template="inchoo/featuredproducts/block_featured_products.phtml" type="core/template" />
</reference>
</default>
</layout>
Then, in your template file(s), use getChildHtml to call your block, like this:
<?php echo $this->getChildHtml('block_featured_products'); ?>
Resources:
Understanding Magento Block and Block Type
To Display .phtml file in another .phtml file. you can use:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('path after template dir/filename.phtml')->toHtml(); ?>
<?php echo $this->getLayout()->createBlock('featuredproducts/listing')->setTemplate('inchoo/featuredproducts/block_featured_products.phtml')->toHtml(); ?>
Go to the extension etc folder where you find config.xml file and in the config.xml file you find tag understanding the block tag you can write your own block tag or you can use that block tag, normally when creating an extension using block tag we move to block folder and in using slash we use to give file name if i want to access Listing .php then i use /listing that's how its work
1) For calling a core template file in .phtml file
<?php
echo $this->getLayout()->createBlock('core/template')->setTemplate('templateFolder/yourtemplate.phtml')->toHtml();
?>
2) For calling a core template file in CMS page
{{block type="core/template" template="templateFolder/your_template.phtml"}}
I am trying to add a bit of HTML to every page of my theme in the after_body_start section of the page.
I created a template here with the following contents app/design/frontend/custompackage/genesis/template/page/custom/siteCanvasAdjustment.phtml:
<p>Hello World</p>
In my local.xml file located here: app/design/frontend/custompackage/genesis/local.xml, I have added the following line of code:
<layout version="0.1.0">
<default>
<reference name="after_body_start">
<bock type="core/template" name="siteCanvasAdjustment" as="siteCanvasAdjustment" template="page/custom/siteCanvasAdjustment.phtml" output="toHtml" before="-" />
</reference>
</default>
However, "Hello World" is still not rendering on the page. I verified that the theme is successfully installed. Changes that I have made to the head.phtml file and placed in my theme work. Also, changes such as the following in local.xml work fine:
<reference name="head">
<action method="removeItem"><type>skin_js</type><name>js/slideshow.js</name></action>
</reference>
Any idea what I am doing wrong? I am new to Magento and read up on all the tutorials but am clearly missing something.
Your local.xml should be under layout folder not directly under theme folder, also your block has spelling mistake it says bock instead of block.
Hope it helps
N.B Don't forget to clear cache.
Cheers
S
Hope you guys can help me out, i can't find any tutorials online regarding this.
How can you use a
<bean:write....>
inside a
<html:form....>
My code is like:
<html:form action="/restricted/client/social/NewsFeedAction.do?action=REPLY&id=<bean:write name='adminFeed' property='id'/>">
then when i check the id value through debugging its just
<bean:write name='adminFeed' property='id'/>
instead of the ID value like 555 or so...
I can confirm that this bean write tag works as can use that within a
<a href...>
tag no problem.
Any ideas?
Thanks!
You cannot use tag inside another tag.
I use small workaround.
<bean:define id="myId" name='adminFeed' property='id'/>
<html:form action="/restricted/client/social/NewsFeedAction.do?action=REPLY&id=${myId}">
I thought this would be simple enough but i cant seem to find a solution to this. All the examples online talk about "editing html" but this option is not there in the maps...at least i cant see it. All i want to do is add a image to the custom place mark I have created. I have made the map public
URL: https://mapsengine.google.com/map/edit?mid=z7IEPC0nBH4A.kVBxNdxzStY8
How do I do this?
I can see two bugs in your html code:
<img src="https://www.dropbox.com/sh/4olxpkce50nijq6/ttNsJsNx5l/IMG_6080.JPG?m />
First, there are missing ending Quotation Mark:
<img src="https://www.dropbox.com/sh/4olxpkce50nijq6/ttNsJsNx5l/IMG_6080.JPG?m" />
Second, you are linking to invalid dropbox image url,
instead of linking "image", you linked to "dropbox page" with this image
try this:
<img src="https://photos-5.dropbox.com/t/0/AACDK3--td1dHfzvjPpZJV7nOHG4TetLvnZcq57l0dPI-g/12/11970178/jpeg/1024x768/3/1367881200/0/2/IMG_6080.JPG/Ipzuc65vlNu4q5l1IRF6ByweEjvI54jmqjRGonaT55Y%2CNbkC0I3psIX50JxgE7E9ooD5ZE9BHKQ13r62AelzYNo" />