84 Posts
Skepsis
10 years ago
Topic
Hello,

I want users to edit their own content. Therefore I created a link to a List&Search Type which redirects automatically to the appropriate form. But what if no content exists? I only get the message that "There is no result". It would be nice to have a redirection to the form to create the content if it doesn´t exists.
Is there a solution for this problem?

Greetings
Skepsis

Get a Book for SEBLOD
10 years ago
5
Level 1

Hi Skepsis

The auto-redirection for "No Result" is already done, and will be available in our next major release.

For now you could use the "Include File" option, and add your custom code there.
YOUR_SEARCH_TYPE > Configuration > "No Result" > Action

Then you go to your template src files, and you will see the "/includes" folder, with the "no_result.php" file. (if you need to enable this action only for this search type, you must create a folder with the name of your search_type inside the /includes, and then put the "no_result.php" file in this folder.)


Regards,
Saba.

84 Posts
Skepsis
10 years ago
0
Level 2

Thank you very much for this useful information.

It´s amazing that SEBLOD has a solution for almost everything.

Greetings
Skepsis

203 Posts
louispapera
9 years ago
1
Level 2
Dear Saba, I have the same problem as Skepsis, I follow your istructions and I also need to redirect in a form for insert data but it do not work well. Why ?
I "create a folder with the name of your search_type inside the /includes, and then put the "no_result.php" file in this folder.".... 
Then, I try to search a record and for not found system does not skow my form for insert a new record.
Many thanks in advance for your kind reply. Best regards, Louis
4229 Posts
Kadministrator
9 years ago
0
Level 3
Hi,

you can try using "Auto redirect" set to Form, if your problem is the same as Skepsis.

To use no_result.php for redirection it is not enough to copy it, default file only outputs no result message, you will also need to place redirect code in that file.
84 Posts
Skepsis
8 years ago
1
Level 2

Hi Saba,

Are there any news about the auto-redirection for "No Result" ?
You said it will be available in the next major release... Which release do you mean? ;)

Regards
Skepsis

8 years ago
0
Level 3

Would really be great to get an update on this - or to get an answer to my question on

http://www.seblod.com/community/forums/lists-search-types/possibilities-within-list-of-search-results-with-no-results#post31322

Thanks a lot!

Best regards
Heinz

9 years ago
1
Level 1
Hello,

I found this snippet that you can use in no_result.php for setting up your redirection with the Joomla API:
// joomla 2.5
$app = JFactory::getApplication();
$link = 'http://www.domain.com/';
$msg = 'You have been redirected to domain.com';
$app->redirect($link, $msg, $msgType='message');
Its for J!2.5 but I think it should work for 3.x also.
203 Posts
louispapera
9 years ago
0
Level 2
Dear Klas thanks for your reply and thanks also to Gebeer for code.
I try the code and now all right, redirect work well.
Best regards, Louis

p.s. to Skepsis: please put solve in this topic. Thanks
9 years ago
0
Level 1
Hello Louis,

glad that the code snippet helped.

I had never used it before myself. So through this thread I discovered ome new redirection possibilities with Seblod :-)
84 Posts
Skepsis
9 years ago
1
Level 1

Maybe some additional infoormation if someone is wondering why it does not work.

Be sure that you take the "no_result.php" file which is located in the template assigned for the "List" view, not for the "Search" one...
The "List" view must contain at least one field. 

Greetings
Skepsis

332 Posts
Kenneth
8 years ago
0
Level 2

Lifesaver, skepsis!! :) That solved it.

Get a Book for SEBLOD