如何将参数值从一页上的超链接传递到ExpressionEngine中的另一页? [英] How to pass a parameter value from a hyperlink on one page to another page in ExpressionEngine?

查看:69
本文介绍了如何将参数值从一页上的超链接传递到ExpressionEngine中的另一页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在带有一些超链接的表达式引擎入口页面上...

I am on an expression engine entry page with a few hyperlinks...

<a href="http://example.com/expressionenginepage/">Go Form</a>
<a href="http://example.com/expressionenginepage/">Go2 Form</a>

基于我单击的超链接,我想导航到带有联系表单的另一个表达式引擎页面,并根据上一页中单击的超链接来动态设置主题字段的值.我要去做吗?我可以设置一个参数值,然后将其传递给expressionengine会话,以便可以在联系表"页面中引用它吗?也许像下面这样的机制?

Based on which hyperlink I click, I want to navigate to another expression engine page with a contact form and dynamically set the value of the subject field based on which hyperlink was clicked on the previous page......How do I go about doing this? Can I set a parameter value which then gets passed to the expressionengine session so I can reference it in the Contact Form page? Perhaps a mechanism like the below?

<a href="http://example.com/expressionenginepage/" ee_value=1>Go Form</a>
<a href="http://example.com/expressionenginepage/" ee_value=2>Go2 Form</a>

推荐答案

我使用selects完成了与此类似的操作,但原理与文本字段相同.

I've done something similar to this with selects, but the principle is the same for text fields.

只需将第二个URL段视为变量.

Simply treat the 2nd URL segment as the variable.

因此,您在这里有表单页面:

So you have your form page here:

http://example.com/expressionenginepage/

如果您希望该表格上的主题行预先填写为请给我打电话",请将链接撰写为

If you want the subject line on that form to be pre-filled out as "Please call me", compose the link as

http://example.com/expressionenginepage/call

如果要将该表单上的主题行预先填写为我需要帮助",请将链接撰写为 http://example.com/expressionenginepage/help

If want the subject line on that form to be pre-filled out as "I need help", compose the link as http://example.com/expressionenginepage/help

然后在模板"expressionenginepage"上查看segment_2变量,并有条件地提供所需的主题行.

Then on your template 'expressionenginepage' look at the segment_2 variable and conditionally serve the subject line that you desire.

{if segment_2 == 'call'}
  <input id="subject" type="text" value="Please call me">
{if:elseif segment_2 == 'help'}
  <input id="subject" type=text value="I need help">
{if:else}
  <input id="subject" type=text value="">
{/if}

这篇关于如何将参数值从一页上的超链接传递到ExpressionEngine中的另一页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆