solved Adding a button in user login page

alt=
@dobmat
11 years ago
93 posts
Hi

I have created a tab in the user's login page by creating a new module. Now I want to add some buttons which lead to other pages. I have looked for examples through documentation, but could'nt find anything that I'm looking for. Please give me some hints or if any documentation if available on the above.

Thanks.
updated by @dobmat: 05/12/14 10:41:45AM
brian
@brian
11 years ago
10,149 posts
I'm not sure what you mean by "creating a tab in the users login page" - can you clarify where you've created a page at?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
what I mean to say was that I created a new tab beside "Blog" and "Pages" on user login page. Now I want to add a button to add new entries there or atleast modify from jrBlog or jrPage. I wanted to know how views are controlled and which php and template files I need to use and modify to my requirements.

Thanks.
brian
@brian
11 years ago
10,149 posts
So when you say "new tab" I'm guessing you are talking about a new menu entry on the user's profile page (like what you see at the top of the page here) - is that correct? If so, those are tied to modules. A module's "views" are located in modules/ModuleName/index.php - i.e.

view_ModuleName_create()

If you're already looking at the jrBlog module, look inside it's index.php to see the create/update/delete views that handle the actual forms.

For what you see when you click on the actual menu item, that is the module's "item_index.tpl" file - i.e.

modules/ModuleName/templates/item_index.tpl

Again, check out the jrBlog one to see how that is setup.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
michael
@michael
11 years ago
7,805 posts
dobmat:
what I mean to say was that I created a new tab beside "Blog" and "Pages" on user login page. Now I want to add a button to add new entries there or atleast modify from jrBlog or jrPage. I wanted to know how views are controlled and which php and template files I need to use and modify to my requirements.

Thanks.

I find the jrAparna module is a great place to start. Its sets up the base foundation of a module to build off of.

"Using the Aparna module"
http://www.jamroom.net/paul/documentation/guides/1218/using-the-jraparna-module

"jrAparna"
http://www.jamroom.net/the-jamroom-network/documentation/modules/853/jraparna

This might also be of use:

YouTube: "Creating a Form and saving it to the Datastore."
Creating a Form and saving it to a Datastore
alt=
@dobmat
11 years ago
93 posts
Thanks a lot for inputs. I'm now able to create menu entries in user profile page. I have created a form to add values to new menu option that I created. But it seems that I cannot save it. I have an index.php file with 2 functions for create and create_save and a profile.php for default view. When I try to submit it does'nt redirect to profile page nor does it clear values typed in the form. I'm not sure if the create_save function is even being called or not. There is nothing in the database either. Please guide me.

Thanks.
michael
@michael
11 years ago
7,805 posts
Did you use the jrAparna module to create the base?

If not its quite possilble that you have forgotten something. Do you have a schema.php file for your module.

There is a course here:

"Developers Guide to Customizing Jamroom"
https://www.udemy.com/developers-guide-to-customizing-jamroom/

That is free to all members in the backstage area:

"100% off coupon for developers guide to customizing Jamroom Udemy course."
https://www.jamroom.net/backstage/forum/resources/3112/100-off-coupon-for-developers-guide-to-customizing-jamroom-udemycom-course

--edit--
This might also be useful:

"Datastores"
https://www.jamroom.net/the-jamroom-network/documentation/development/1023/datastores
updated by @michael: 04/01/14 03:50:38AM
alt=
@dobmat
11 years ago
93 posts
I have the schema.php in my module. I put echo dbug() in create save function. I'm getting "a system level error was encontered trying to validate the form values: error: internal server error".

Thanks.
brian
@brian
11 years ago
10,149 posts
The function is "debug()" - not "dbug()". The problem too is that debug() is not going to work properly if the response is a JSON response to an AJAX call - in that case use fdebug() so the debug contents are written to your data/logs/debug_log file.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
There was something wrong in my form create function with the prefix for module name which was why validation was failing. That is fine now. But the redirect is failing due to backslaches on the URL.

Thanks.
alt=
@dobmat
11 years ago
93 posts
Here is the error message after adding debug,

JSON response error:

(10:42:11 0.40911800)-(router.php)-(1211848)
|print|

1{"redirect":"http:\/\/localhost\/jamroom\/admin\/Venues"}
michael
@michael
11 years ago
7,805 posts
Jamroom wont work on Windows. It only runs on Linux.

Try making the base of your module with the jrAparana module.

If what it makes also fails to be able to update and save, then its probably a server error.

If what it makes works, then its something in your module.
alt=
@dobmat
11 years ago
93 posts
I'm running Jamroom on linux machine. I tried to download the jrAparna module. But getting requested URL not found. My FTP settings in global config is fine.

Thanks.
brian
@brian
11 years ago
10,149 posts
dobmat:
I'm running Jamroom on linux machine. I tried to download the jrAparna module. But getting requested URL not found. My FTP settings in global config is fine.

Where are you getting the URL error at? Is that from within your marketplace?

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
Yes marketplace within ACP.
brian
@brian
11 years ago
10,149 posts
I just installed Aparna here via the Marketplace without a problem - make sure you go into your ACP -> Core -> Marketplace -> Tools -> Marketplace Systems and that your settings for "The Jamroom Network" are correct.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
I could download the jrAparna module and also it seems I'm not having redirect problem as before. Not sure how. I have a profile.php in my module which has default view function, I tried to use the jrBlog module as example. But I don't see the items created by the user earlier listen below the module tab. Should I have the default view funtion in profile.php or in index.php?

Thanks.
brian
@brian
11 years ago
10,149 posts
All you need for the default profile view is a module/templates/item_index.tpl file - that is the "default" view. If you have a profile.php file though, that works as a "router" for the profile views. If you have a "default" view in your profile.php script then that view will need to handle - otherwise if there is no default view (i.e. profile_view_MyModule_default) it will "fall through" to the the item_index.tpl file.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
Thanks for the inputs. I'm able to display all the items created under new entry in user profile page. I've designed form to upload an image. Using the jrPage item_list.tpl I can get user_image but I want to display the image uploaded during form create. I not figureout the URL for the uploaded image. Please help.

Thanks.
brian
@brian
11 years ago
10,149 posts
Can you show me the code you are using right now to display the image? And by "I want to display the image uploaded during form create" do you mean the Profile image? Not sure what image you mean..

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
Template code is a below,

{jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" class="iloutline" item_id=$item._user_id size="small" crop="auto" alt=$item.user_name}


When I said image I mean the one which an user will upload when he fills out a form like creating new blog for jrBlog module. I want the image to be shown along with the name of the entry on module for a profile.
Screenshot.png
Screenshot.png  •  22KB


updated by @dobmat: 04/08/14 02:46:11AM
alt=
@dobmat
11 years ago
93 posts
Also I want to add a dashboard for users which will show entries from calendar. Please guide me on this. I found that to add dashboard to profiles I will have to create a module. Can you please give some more details.

Thanks.
michael
@michael
11 years ago
7,805 posts
The uploaded image will only be present on update. The image is not saved until the form is submitted.

When you click on update after having uploaded an image, then you can see it. You can see this happening in the jrAudio module.

The image is there on UPDATE but not on CREATE.
brian
@brian
11 years ago
10,149 posts
dobmat:
Also I want to add a dashboard for users which will show entries from calendar. Please guide me on this. I found that to add dashboard to profiles I will have to create a module. Can you please give some more details.

Thanks.

Please start a new thread for any new questions that are not related to the original topic here.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
I'm sorry for including other topics in this thread. Created a new thread for dashboard query.

Regarding the image what I want is for it to show up under new module tab as in screenshot below. The new venue created "test" is shown but not the uploaded venue image.

Thanks.
Screenshot-1.png
Screenshot-1.png  •  46KB


updated by @dobmat: 04/08/14 08:14:53AM
michael
@michael
11 years ago
7,805 posts
put a {debug} in the modules item_list.tpl file to see what variables you have to work with.

look in other modules item_list.tpl files for structure for what your trying to do.

Its probable that the image display code is not using the correct datastore key for the image you want. See how the audio module uses

 module="jrAudio" type="audio_image" 
to display its audio_image.

You would need to use whatever datastore key is used to hold the image.
alt=
@dobmat
11 years ago
93 posts
I'm guessing datastore key should be 'name' in the form create function. Am I right. The info from smarty debug console is as below,
venues_title => "Manchester"
venues_title_url => "manchester"
venues_image_name => "index.jpeg"
venues_image_size => "4815"
venues_image_time => "1397042734"
venues_image_type => "image/jpeg"
venues_image_width => "204"
venues_image_height => "204"
venues_image_extension => "jpeg"

I tried with type as venues_image which is what I have given in form create function along with name of my module. But I still don't see the image.

Thanks.
brian
@brian
11 years ago
10,149 posts
Yes - when creating forms you want to use the proper name - it should match up with your DS prefix - i.e. if the DS name is "venues_title" then in your form the "name" should be "venues_titles".

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
alt=
@dobmat
11 years ago
93 posts
I cannot see the image still. Its not it the database also. There is only one thing against item id i.e venue name. there is no venue image. Please help.

Thanks.
michael
@michael
11 years ago
7,805 posts
Its easier if you tell us what code your using. Saves guessing.

The audio module displays an image in the templates like this:
{jrCore_module_function function="jrImage_display" module="jrAudio" type="audio_image" item_id=$item._item_id ......

so your code would be similar, just replace the module="jrAudio" with whatever your module's name is. and the image field with type="venues_image" and pass in the item id of the venue you want to display the image for.
alt=
@dobmat
11 years ago
93 posts
Thanks a lot, its working now, something wrong with item_id. Also clicking the image does not lead to page showing item details. I have an item_detail.tpl. Instead it is redirecting to item_list.tpl showing all the items created. The URL on the image is correct showing item number and name.

Thanks.

Tags