Loading...
 
Skip to main content

Features / Usability


insert original value into a form

posts: 68

I would like to insert an original value into a form - something like including "username" into the username field.

I want to write in the Heading field of tiki-edit_submission.php page, "Insert Link Here" so that whenever the page loads, this comes up as a guideline to people who submit articles.

Could somebody please tell me how I do this. I used to previously edit the tiki-edit_submission.tpl file and just included it after $heading|escape) and before /textarea>

However, it is not working with 1.85 now. Please advise.

posts: 1092

in the php you have to do something like
$smarty->assign('username', $user)

After you can use {$username} in the associated tpl

Image
Copy to clipboard
{if $heading}{$heading|escape}{€lse}{$username|escape}
posts: 68

Thanks Sylvie, but I think I did not frame my question properly.

In the tiki-edit_submission page, in the Heading field of that page, whenever that page loads, I want the following to appear as a guideline for the submitting author:

Image
Copy to clipboard
[ Insert Link here | Source ]


So that, the author understands that all he has to do is replace "Insert Link here" with the URL itself.

Please tell me how to do that.

posts: 3665 United States

In the tiki-edit_submission.tpl page, change this:

Image
Copy to clipboard
<textarea class="wikiedit" name="heading" rows="5" cols="80" id='subheading' wrap="virtual"> {$heading|escape} </textarea>


to this:

Image
Copy to clipboard
<textarea class="wikiedit" name="heading" rows="5" cols="80" id='subheading' wrap="virtual"> {if $heading}{$heading|escape}{else}[ Insert Link Here | Source]{/if} </textarea>


This way, if the page already has a heading, it will be displayed. However, if the page does not yet have a heading, the user will see: Source


-Rick


posts: 68

Never mind, Sylvie - I rectified this problem and many others by using edit_article.php rather than edit_submission.php

I could rectify this problem by my old method itself, which I gave here.

The other problems that are present in edit_submission.php are: Dating all submissions to 1970 by default! And not displaying all Article types that were created. These problems are also solved by using edit_article.php

posts: 78 India

Can you pls attach your modified edit_article.php?

> Never mind, Sylvie - I rectified this problem and many others by using edit_article.php rather than edit_submission.php
>
> I could rectify this problem by my old method itself, which I gave here.
>
> The other problems that are present in edit_submission.php are: Dating all submissions to 1970 by default! And not displaying all Article types that were created. These problems are also solved by using edit_article.php