additional parameters in magento's customer.xml layout file - magento-1.4

i'm trying to add some explanatory text to the top customer links (my account, my cart etc) via the customer.xml file from the blank theme (this is in Magento 1.4.1.1)
i think that magento has the capability out of the box by issuing afterText or beforeText parameters, but when i use them it only seems to shove things before the link (not after, which is what I'm after).
here's an extract from customer.xml that includes the additional < afterText > parameter:
<default>
<!-- Mage_Customer -->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Your Account</label><url helper="customer/getAccountUrl"/><title>Your Account</title><prepare/><urlParams/><position>10</position><null /><aParams>rel="nofollow"</aParams><afterText>click to login</afterText></action>
</reference>
</default>
has anyone had any luck with this before? does it need some additional arguments for liParams?
thanks in advance!
EDIT: here's the final code that seems to be working for me. Note the addition of the extra fields as suggested by
thanks for this, it helped a lot. both you and #Zyava answer below helped me sort it out.
There's one field missing from your suggestion above (the innerText field). I've put the full code below that looks to be working for me. hope it helps someone else!
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<liParams/>
<aParams>rel="nofollow"</aParams>
<innerText/>
<beforeText>yourbeforetext</beforeText>
<afterText>youraftertext</afterText></action>
big thank you to #clockworkgeek and #zyava - both of your answers helped me get through this.

Unfortunately the XML tag names don't relate to the variable parameters, it is the number of parameters that matters. You need to specify all parameters up to afterText including beforeText.
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<position>10</position>
<liParams/>
<aParams>rel="nofollow"</aParams>
<beforeText/>
<afterText>click to login</afterText>
</action>

Block 'top.links' has type Mage_Page_Block_Template_Links. Look at Mage_Page_Block_Template_Links::addLink() method:
public function addLink($label, $url='', $title='', $prepare=false, $urlParams=array(),
$position=null, $liParams=null, $aParams=null, $beforeText='', $afterText='')
{
As we can see, $afterText parameter exists here. Now go to your theme's page/template/links.phtml, in my case it is \app\design\frontend\base\default\template\page\template\links.phtml and check that something like <?php echo $_link->getAfterText() ?> is present there.

Related

How do I query (via url) the solr.admin.LukeRequestHandler to get collection index data

I want to use the luke handler as suggested in Solr schema, how to get dynamic fields in a collection, which is http://solr:8983/solr/admin/luke?numTerms=0
but the 4.10.3 solrconfig.xml has the following entry which indicates luke has been rolled into /admin/ and I should be able to use the http://localhost:8983/solr/admin path, which give me a 404 error.
<requestHandler name="/admin/"
class="solr.admin.AdminHandlers" />
<!-- This single handler is equivalent to the following... -->
<!--
<requestHandler name="/admin/luke" class="solr.admin.LukeRequestHandler" />
<requestHandler name="/admin/system" class="solr.admin.SystemInfoHandler" />
<requestHandler name="/admin/plugins" class="solr.admin.PluginInfoHandler" />
<requestHandler name="/admin/threads" class="solr.admin.ThreadDumpHandler" />
<requestHandler name="/admin/properties" class="solr.admin.PropertiesRequestHandler" />
<requestHandler name="/admin/file" class="solr.admin.ShowFileRequestHandler" >
-->
When I look for LukeRequestHandler documentation I find http://lucene.apache.org/solr/4_4_0/solr-core/org/apache/solr/handler/admin/LukeRequestHandler.html which expects I am building a java app, which I am not.
I attempt to use several methods found there in a url, all of which 404.
In addition to "how do I query the luke handler to get index data",
"is this the correct documentation for what I am trying to figure out?".
Any help in understanding how (these) java docs relate to me trying to understand how Solr works from url would be greatly appreciated.
I spent some days scratching my head with the same issue. Apparently, you need to include the name of your core into every request.
Testing with the "gettingstarted" core:
http://localhost:8983/solr/admin/luke/ gives 404.
http://localhost:8983/solr/gettingstarted/admin/luke/ gives an XML with the information of the index.
Check if this solves your problem.

Ant tasks don't run IN IzPack installer

.
Hello, everyone
I'm studying IzPack as a tool to be used in a future project and I'm really enjoying it. It's as flexible as I need and makes the process much more easy. I have even submmited a silly pull request at github with a modification I needed to my purposes. Who knows?
Although I don't find it particularly complicated, I've been stuck trying to use a resource for some days. I need that certain Ant Tasks to be executed in certain points of the installation process (right before everything is unpacked is the really one that matters) and that is not working, besides all the efford. :(
My current state, that seems right looking at examples, is the following:
[ My current use of this is based on an example I found here (the docs don't clear too much when It cames to these kind of Actions.]
In my definitions xml file, I included some things:
First, the AntActionsSpect.xml and the .jars, followed by the listeners:
<resources>
...
<res id="AntActionsSpec.xml" src="specs/AntActionsSpec.xml" />
...
</resources>
<jar src="libs/ant/ant.jar" stage="both" />
<jar src="libs/ant/ant-launcher.jar" stage="both" />
<listeners>
<listener classname="AntActionInstallerListener" stage="install" />
<listener classname="AntActionUninstallerListener" stage="uninstall" />
</listeners>
<pack name="test_app" required="yes" installGroups="Application Core">
...
In the specs/AntActionsSpec.xml file, I have the following:
<pack name="test_app">
<antcall order="beforepacks" quiet="no" verbose="yes" buildfile="$INSTALL_PATH/ant-tasks.xml">
<property name="INSTALL_PATH" value="$INSTALL_PATH" />
<target name="touch_beforepacks" />
</antcall>
</pack>
And the ant-tasks.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<target name="touch_beforepacks">
<touch file="$INSTALL_PATH/beforepacks.txt"/>
</target>
</project>
Nothing special here, just creating a dumb file.
The ant-tasks.xml is unpacked right before anyone else. Everything builds with no error, even if I create one "mistake" at AntActionsSpec or ant-tasks.xml, what suggests me that they aren't even been loaded, though if I mess with the path where the definitions file has them, the build will fail.
I would like some help addressing that. I'm probably making some stupid little error and just can't see it by myself. If any of you could provide an example of a running build, that would be sweet.
If I can give any more information, please, let me known so I can update the question.
Thank you very much.
Just found it using a forum on a Google Groups discussion: [izpack-user] Quick question on variable substitution.
Unfortunattly the I will conclude that the docs are misleading. The docs in
"AntActionInstallerListener and AntActionUninstallerListener" until this date are stating that I should use this listener configuration:
<listeners>
<listener classname="AntActionInstallerListener" stage="install" />
<listener classname="AntActionUninstallerListener" stage="uninstall" />
</listeners>
That is what is up there, in the question. Comparing my XML code with the one in the Google Groups discussion, I found a different use of it:
<listeners>
<listener installer="AntActionInstallerListener"
uninstaller="AntActionUninstallerListener" />
</listeners>
In fact, that is the instruction given in the other wiki: Ant Actions (InstallerListener and UninstallerListener), what points out that I something can be wrong under the hood, but that is a story to another episode.
That just works. The Ant tasks are executed properly. :)
I just could not find where freaking Codehaus will allow me to grab a login and edit the docs wiki. >:( . If someone could endorse-me with some testing and then adjust the wiki for future happiness or just give a link to this tired programmer, I'd be happy.

Where to edit footer links Magento 1.9

I'm trying to figure out where to edit footer links in magento 1.9 but I couldn't find anything I'll be searching it for almost 3hours but no success. Sorry I'm just a newbie in magento.
I want to edit the links under "QUICK LINKS" "ACCOUNT" I found the link under company and it's in magento backend under static blocks but no success for the two.
Thanks
These links are added in multiple layout files. The easiest way is to do a directory search (in your IDE) for "footer_links" phrase on the "layout/*.xml" files. You'll see that some links are being set in sales.xml, customer.xml or cms.xml. At the bottom of sales.xml for example you should see something like this:
<default>
<reference name="footer_links2">
<block type="sales/guest_links" name="return_link"/>
<action method="addLinkBlock"><blockName>return_link</blockName></action>
</reference>
</default>
This tells Magento to add the "Orders and Returns" link to the "Account" block in the footer. If you change the footer_links2 to footer_links, this link will end up in the "Quick Links" block. I think once you find this, you'll figure out the rest.
The other links and title are set via layout system:
page.xml:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>
<block type="page/switch" name="store_switcher" as="store_switcher" after="*" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml">
<action method="setTitle"><title>Quick Links</title></action>
</block>
<block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml">
<action method="setTitle"><title>Account</title></action>
</block>
<!-- This static block can be created and populated in admin. The footer_links cms block can be used as a starting point. -->
<!--<block type="cms/block" name="footer_social_links">
<action method="setBlockId"><block_id>footer_social_links</block_id></action>
</block>-->
</block>
Then in catalog.xml links are added:
<reference name="footer_links">
<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
The links are available on Admin menu -> CMC -> static block
Here available Footer Links, and repalace/modify the required links.
on CMS/pages you can find an option to edit the footer whatever you want.
Bro, You can create your a custom static block and add it to your footer, just replace the old one. Hope that helps..cheers..
Hi it can also simple.
Paste in your style.css from your themes.
ul.links { display:none}
or on another class from the first block. And make new links in your first block in the admin by statisch block.

Ignore the slash in Magento <url>

I’ve created a menu in page.xml and it looks like this:
<reference name="primary.menu">
<action method="addLink" translate="label title">
<label>Test</label>
<url>test.html</url>
<title>Test</title>
<prepare>1</prepare>
<urlParams/>
<position>10</position>
<liParams>dark-gray</liParams>
<aParams></aParams>
<beforeText></beforeText>
<afterText></afterText>
</action>
...................
The class used for the primary.menu block is extending the Mage_Page_Block_Template_Links class from Magento’s core.
The problem is, that when I click this link it goes to ‘www.mydomain.com/test.html/’ which is not working. My question is what should I do in order to stop the last ‘/’ from showing in the url?
I think that <prepare>1</prepare> is building your URL query (in the absence of a dedicated helper to supply the URL) and as a result is prefixing your URL with the domain (which is what you want), but it is also appending a trailing slash (which is what you don't want)
Either create a helper to supply the "proper" URL.
If the page is a Magento CMS page, use that helper (preferred)
Use <prepare/> and <url>/test.html</url> (hack alert!)
To use a Magento CMS helper to add a link
<action method="addLink" translate="label title before_text" module="cms">
<label>Test</label>
<url helper="cms/page/getPageUrl">
<page_id>1</page_id>
</url>
<title>Test</title>
<prepare/>
<urlParams/>
<position>10</position>
<li/>
<a/>
<before_text/>
<after_text/>
</action>

Get URL and parameters with SSI

I have to get URL and parameters with SSI (only with SSI), but I can't find any solution.
For example: http://www.test.com/abc.html?data=something
And I have to get value of parameter "data".
<!-- set default value for SSI variable "data" -->
<!--#set var="data" value="" -->
<!-- get "data" value from URL -->
<!--#if expr="$QUERY_STRING = /data=([a-zA-Z0-9]+)/" -->
<!--#set var="data" value="$1" -->
<!--#endif -->
<!-- print the "data" value -->
<!--#echo var="data" -->
old question I know, but I just came across it while doing some SSI stuff myself. I'm sure you've fixed your problem by now, but if this doesn't help you, perhaps it will someone else. I'm assuming the server is Apache. (If not, then I guess this isn't going to work!)
First the disclaimer! I'm by no means an apache, sed, or regex master, so I'm sure what follows can be improved, but it may be a start. It just prints the page relative to the base of the site and the parameter of the data query.
<!--#echo var="DOCUMENT_URI" -->
<!--#exec cmd="echo '$QUERY_STRING' | sed -n 's/\([^&]*&\)*data=\([^&]*\).*/\2/p'" -->
I found a list of apache environment variables here: http://www.zytrax.com/tech/web/env_var.htm, and to find out what you can do with this stuff once you've retrieved it look here: http://httpd.apache.org/docs/2.0/howto/ssi.html.
Edited to make it print nothing rather than the whole string when no data attribute is found.

Resources