View Full Version : Element Link
alanparis
06-26-2007, 07:23 PM
Hi, I need to connect the result of a table to the content of the component.
In the element id using the links.
Es. the result of the table from this link
www.mysite.com/76
where 76 are the id of the field of the table
I must get www.mysite.com/component/option, com_alberghi /task,detail/Itemid,/id,76
to add us the id (76 or other).
How can I do?
Thanks
alanparis
06-27-2007, 08:43 PM
can nobody help me?
andrelewis
06-28-2007, 07:52 AM
You will probably have to do something with mod_rewrite in Apache, using .htaccess
I do not think you can do it otherwise.
see www.apache.org : http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
alanparis
06-28-2007, 08:54 AM
Thanks Andre, excuse but I don't understand
It misses a part of the pathway.
I have need in the element link of table the path of the component for open the article with all the information
Now the path is www.mysite.com/76 (where 76 is variable id)
I need www.mysite.com/component/option,com_alberghi/task,detail/Itemid,/id,76
... is possible?
You could create a custom table template to do this:
make a copy of /components/com_fabrik/tmpl/table/standard.html
rename it to new.html
edit your table and select "new.html" for the table's template
Then edit new.html and replace it with a custom table template, details of how to make one are in the docs i think, but basically it would look something like:
<form action="{FABRIK_PAGEURL}" method="post" id="fabriktable" name="fabriktable">
<mos:tmpl name="show-add" type="simplecondition" requiredvars="showAdd=1">
<span class="pagenav">
<a href="{ADDRECORDLINK}">Add Listing</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-csv" type="simplecondition" requiredvars="showCSV=1">
<span class="pagenav">
<a href="{CSVLINK}">Export to CVS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-rsslink" type="simplecondition" requiredvars="showRSS=1">
<span class="pagenav">
<a href="{RSSLINK}">Subscribe RSS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-filters" type="simplecondition" requiredvars="showfilters=1">
<table class="filtertable" style="float:right;width:200px;border:1px solid #cccccc;" cellpadding="5" cellspacing="0">
<tr style="background-color:#cccccc;font-weight:bold;">
<th colspan="2" style="text-align:left">Search:</th>
</tr>
<mos:tmpl name="filters">
<tr>
<td>{NAME}</td>
<td style="text-align:right;">{VALUE}</td>
</tr>
</mos:tmpl>
<tr>
<td colspan="2" style="text-align:right;">
<mos:tmpl name="filter-form" type="simplecondition" requiredvars="filterform=1">
<input type="button" onclick="submitfabrikTable('filter')" class="button" value="Go" name="filter" />
</mos:tmpl>
</td>
</tr>
</table>
</mos:tmpl>
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
<mos:sub condition="0">
{EMPTY_DATA_MSG}
</mos:sub>
<table>
<tr>
<th>Name</th>
<th>Link</th>
</tr>
<mos:sub condition="__default">
<mos:tmpl name="named-rows">
<tr>
<td><mos:var name="jos_users.name" /></td>
<td><a href="www.mysite.com/component/option,com_alberghi/task,detail/Itemid,/id,<mos:var name="jos_users.id" />">Link to component</a></td>
</tr>
</mos:tmpl>
</mos:sub>
</mos:tmpl>
</table>
<div style="text-align:center;margin:auto;">
{FABRIK_DELETEBUTTON}
{FABRIK_PAGENAV}
</div>
<mos:tmpl name="hidden-fields">
<input type="hidden" name="{NAME}" value="{VALUE}" id="{ID}" />
</mos:tmpl>
</form>
<mos:comment>
<mos:var name="fabrik_templatevars" />
</mos:comment>
alanparis
06-29-2007, 05:26 PM
hi Rob,
My test is failed! I have create the template new.html and the link to component run good but one error is the result to pagination.
error
pat-Notice: No cdata is allowed inside a template of type condition (cdata was found in named-groups) in table/new.html on line 59
Another error is in the filter table. Yhis don't word.
In attach A file you view the normal situation of the site
In the B file the template new.html in action
?? do you help me, thanks
alan
alanparis
06-29-2007, 10:15 PM
I have solved the problem of filter. To access is possible only user Register?
This is the error to template new.html and images are post before:
pat-Notice: No cdata is allowed inside a template of type condition (cdata was found in named-groups) in table/new.html on line 58
Another problem is the pagination - I need the link near the row of respective id and all in layout template site.
Post my new.html for help me!
thanks, alan
alanparis
07-01-2007, 09:10 AM
Please, help me Rob.
I have tried to correct the template but I am not able.
alan
hi alan
Please post your template file, that error occurs when you put some html code between the start of a conditional template and the condition its testing for.
e.g.
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
hello
<mos:sub condition="0">
will give you this error
but
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
<mos:sub condition="0">
hello
wont
alanparis
07-02-2007, 10:45 AM
hi Rob,
this the template file. Help me to review the code?
There are two form action ... is incorrect ...
One for the link to component and one for the data ... ???
thanks
alan (confusion)
try this:
<form action="{FABRIK_PAGEURL}" method="post" id="fabriktable" name="fabriktable">
<mos:tmpl name="show-add" type="simplecondition" requiredvars="showAdd=1">
<span class="pagenav">
<a href="{ADDRECORDLINK}">Add Listing</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-csv" type="simplecondition" requiredvars="showCSV=1">
<span class="pagenav">
<a href="{CSVLINK}">Export to CVS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-rsslink" type="simplecondition" requiredvars="showRSS=1">
<span class="pagenav">
<a href="{RSSLINK}">Subscribe RSS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-filters" type="simplecondition" requiredvars="showfilters=1">
<table class="filtertable" style="float:right;width:200px;border:1px solid #cccccc;" cellpadding="5" cellspacing="0">
<tr style="background-color:#cccccc;font-weight:bold;">
<th colspan="2" style="text-align:left">Search:</th>
</tr>
<mos:tmpl name="filters">
<tr>
<td>{NAME}</td>
<td style="text-align:right;">{VALUE}</td>
</tr>
</mos:tmpl>
<tr>
<td colspan="2" style="text-align:right;">
<mos:tmpl name="filter-form" type="simplecondition" requiredvars="filterform=1">
<input type="button" onclick="submitfabrikTable('filter')" class="button" value="Go" name="filter" />
</mos:tmpl>
</td>
</tr>
</mos:tmpl>
</table>
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
<mos:sub condition="0">
{EMPTY_DATA_MSG}
</mos:sub>
<table>
<tr>
<th>Name</th>
<th>Link</th>
</tr>
<mos:sub condition="__default">
<mos:tmpl name="named-rows">
<tr>
<td><mos:var name="jos_users.name" /></td>
<td><a target="_blank" href="/dnn/component/option,com_alberghi/task,detail/Itemid,/id,<mos:var name="jos_alberghi.id" />">mostra</a></td>
</tr>
</mos:tmpl>
</mos:sub>
</mos:tmpl>
</table>
<div style="text-align:center;margin:auto;">
{FABRIK_DELETEBUTTON}
{FABRIK_PAGENAV}
</div>
<mos:tmpl name="hidden-fields">
<input type="hidden" name="{NAME}" value="{VALUE}" id="{ID}" />
</mos:tmpl>
</form>
<mos:comment>
<mos:var name="fabrik_templatevars" />
</mos:comment>
you had two copies of the template in the same file and
</table>
</mos:tmpl>
rather than
</mos:tmpl>
</table>
which was causing the error
alanparis
07-03-2007, 09:00 AM
thanks for the patience, I try!
alan
alanparis
07-03-2007, 02:23 PM
Hi Rob, the test is failed.
This the error
pat-Notice: No cdata is allowed inside a template of type condition (cdata was found in named-groups) in table/new.html on line 57
and the image the situation in the layout! ???
They miss the data and it is everything in horizontal the link "mostra"
what can I do?
thanks, alan
try:
<form action="{FABRIK_PAGEURL}" method="post" id="fabriktable" name="fabriktable">
<mos:tmpl name="show-add" type="simplecondition" requiredvars="showAdd=1">
<span class="pagenav">
<a href="{ADDRECORDLINK}">Add Listing</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-csv" type="simplecondition" requiredvars="showCSV=1">
<span class="pagenav">
<a href="{CSVLINK}">Export to CVS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-rsslink" type="simplecondition" requiredvars="showRSS=1">
<span class="pagenav">
<a href="{RSSLINK}">Subscribe RSS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-filters" type="simplecondition" requiredvars="showfilters=1">
<table class="filtertable" style="float:right;width:200px;border:1px solid #cccccc;" cellpadding="5" cellspacing="0">
<tr style="background-color:#cccccc;font-weight:bold;">
<th colspan="2" style="text-align:left">Search:</th>
</tr>
<mos:tmpl name="filters">
<tr>
<td>{NAME}</td>
<td style="text-align:right;">{VALUE}</td>
</tr>
</mos:tmpl>
<tr>
<td colspan="2" style="text-align:right;">
<mos:tmpl name="filter-form" type="simplecondition" requiredvars="filterform=1">
<input type="button" onclick="submitfabrikTable('filter')" class="button" value="Go" name="filter" />
</mos:tmpl>
</td>
</tr>
</mos:tmpl>
</table>
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
<mos:sub condition="0">
{EMPTY_DATA_MSG}
</mos:sub>
<mos:sub condition="__default">
<table>
<tr>
<th>Name</th>
<th>Link</th>
</tr>
<mos:tmpl name="named-rows">
<tr>
<td><mos:var name="jos_users.name" /></td>
<td><a target="_blank" href="/dnn/component/option,com_alberghi/task,detail/Itemid,/id,<mos:var name="jos_alberghi.id" />">mostra</a></td>
</tr>
</mos:tmpl>
</table>
</mos:sub>
</mos:tmpl>
<div style="text-align:center;margin:auto;">
{FABRIK_DELETEBUTTON}
{FABRIK_PAGENAV}
</div>
<mos:tmpl name="hidden-fields">
<input type="hidden" name="{NAME}" value="{VALUE}" id="{ID}" />
</mos:tmpl>
</form>
<mos:comment>
<mos:var name="fabrik_templatevars" />
</mos:comment>
alanparis
07-04-2007, 11:22 AM
Wuaooooooooo Rob, thanks, I'm happy you have solve my big problem.
Now I have only the question to center the table in the layout (in the image C see the result)... and understand what version fabrik to use (in other post wiht Andre e Joaquin I have required this)
I try to manage html code for center template! I fink, when is solved this, is very important for other user to comment the code of template new.html for personalize table to link component).
Thank you very much Rob!
alan
alanparis
07-04-2007, 12:40 PM
Ok, I post the finish code and comment to insert data for personalize this template.
Link the data for view page of component
1) Create a new.html template
2) Copy into this code
<mos:comment>
@version 4.5.2
@package fabrik
@copyright (C) 2005 Rob Clayburn
@license http://www.gnu.org/copyleft/gpl.html GNU/GPL
</mos:comment>
<h1>{LABEL}</h1>
<p>{INTRODUCTION}</p>
<form action="{FABRIK_PAGEURL}" method="post" id="fabriktable" name="fabriktable">
<mos:tmpl name="show-add" type="simplecondition" requiredvars="showAdd=1">
<span class="pagenav">
<a href="{ADDRECORDLINK}">Add Listing</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-csv" type="simplecondition" requiredvars="showCSV=1">
<span class="pagenav">
<a href="{CSVLINK}">Export to CVS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-rsslink" type="simplecondition" requiredvars="showRSS=1">
<span class="pagenav">
<a href="{RSSLINK}">Subscribe RSS</a>
</span>
</mos:tmpl>
<mos:tmpl name="show-filters" type="simplecondition" requiredvars="showfilters=1">
<table class="filtertable" style="float:right;width:200px;border:1px solid #cccccc;" cellpadding="5" cellspacing="0">
<tr style="background-color:#cccccc;font-weight:bold;">
<th colspan="2" style="text-align:left">Search:</th>
</tr>
<mos:tmpl name="filters">
<tr>
<td>{NAME}</td>
<td style="text-align:right;">{VALUE}</td>
</tr>
</mos:tmpl>
<tr>
<td colspan="2" style="text-align:right;">
<mos:tmpl name="filter-form" type="simplecondition" requiredvars="filterform=1">
<input type="button" onclick="submitfabrikTable('filter')" class="button" value="Go" name="filter" />
</mos:tmpl>
</td>
</tr>
</table>
</mos:tmpl>
<br style="clear:both;" />
<br />
<mos:tmpl name="named-groups" type="condition" conditionvar="rowcount">
<mos:sub condition="0">
{EMPTY_DATA_MSG}
</mos:sub>
<mos:sub condition="__default">
<table width="100%" style="width:100%;border:1px solid #cccccc;" cellpadding="5" cellspacing="0" class="mfDataTable">
<tr style="background-color:#cccccc;font-weight:bold;">
<th align="left">labelfieldname1</th>
<th align="left">labelfieldname1</th>
<th align="left">labelfieldname1</th>
<th align="left">Link </th>
</tr>
<mos:tmpl name="named-rows">
<tr>
<td><mos:var name="jos_tablename.fieldname1" /></td>
<td><mos:var name="jos_tablename.fieldname2" /></td>
<td><mos:var name="jos_tablename.fieldname3" /></td>
<td><a target="_blank" href="/pathtocomponents/id,<mos:var name="jos_tablename.id" />">Link</a></td>
</tr>
</mos:tmpl>
</table>
</mos:sub>
</mos:tmpl>
<div style="text-align:center;margin:auto;">
{FABRIK_DELETEBUTTON}
{FABRIK_PAGENAV}
</div>
<mos:tmpl name="hidden-fields">
<input type="hidden" name="{NAME}" value="{VALUE}" id="{ID}" />
</mos:tmpl>
</form>
<mos:comment>
<mos:var name="fabrik_templatevars" />
</mos:comment>
at the code
<th align="left">labelfieldname1</th>
<th align="left">labelfieldname2</th>
<th align="left">labelfieldname3</th>
<th align="left">Link </th>
change for your LABEL
at the code
<td><mos:var name="jos_tablename.fieldname1" /></td>
<td><mos:var name="jos_tablename.fieldname2" /></td>
<td><mos:var name="jos_tablename.fieldname3" /></td>
change with your element of table
for this code
<td><a target="_blank" href="/pathtocomponents/id,<mos:var name="jos_tablename.id" />">Link</a></td>
copy your path to components
for id use the id element of your table
for tablename use your table of components
This link run in _blank page if you prefer display in same window delete target="_blank" in <a target="_blank" href...>
be Happy! I'm Happy!
alan
alanparis
07-04-2007, 03:21 PM
Thanks Rob for help and solution!
alan
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.