How we call "Pages" name in Dropdown in Signup form of PHPfox? - phpfox

In PHPfox, i want to call "Pages" name in drop-down in Signup form. Reason for calling "Pages", Actually i have created many pages for college name & that are saved in database. So if someone comes for signup, i want to show them college name in drop-down (which are basically "Pages").
Please help me.
Thanks in advance.

You will need 2 plugins, one to show the HTML and one to process what to do with the user input:
1) Make a plugin that fetches the pages, maybe the hook user.component_controller_register_1 or another in that controller would do but otherwise you can always use a low level hook like run_start and check if its the section where you want it.
To show the HTML you have 2 options: include a JS file to populate the sign up form with anything that you want, or if you have a custom template you can just assign the array to the template variable and look through it in your template.
2) Once the html part is showing and working make a plugin for the sign up routine, I think the hook user.service_process_add_1 should be enough given its location.
Dont forget that the input name for the signup is an array, so your drop down needs to look somewhat like this:
<select name="val[my_dropdown]">

Related

How can I preview Virtuemart2 Order verification email layout changes?

I am trying to change the layout ( css/html structure) of Virtuemart 2 order verification emails. Problem is that I have to make a fake purchase each and every time I do a change in the 10 different files (located # components/com_virtuemart/views/invoice/order/tmpl) that create this email template.
The closest "preview" I got was this direct access url "http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=invoice&format=html&tmpl=component&virtuemart_order_id=1401"
But again it loads Joomla's head/body elements not the actual email template.
So how can I have a "preview" of how the template looks like with my new changes BEFORE make an actual test purchase? Is this possible?
You shouldn't change the core files otherwise the next update of VirtueMart (of which there are many) will erase your changes.
You should use Joomla!'s template overrides which VM2 supports that way you can update as needed to new versions without loosing your changes. See this article on docs.joomla.org on "How to override the output from the Joomla! core" and this one on template overrides.
3. You need to add the &format=raw at the end of the link to retrieve just the output of the component with out the template/html body wrapped around it. Of course that relies on the component as well.
I was going to suggest using raw, but looking at the current VM2 it doesn't properly support the format=raw option. Looking at the mail layout in the invoice view it not structured to return it the way you expect, it actually generates a HTML version by default with a matching text only version.
The best I could come up given those two options
Return a close equivalent of the HTML email
http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=mail&virtuemart_order_id=1401&tmpl=component
Return the text version, albeit wrapped in the html page... you may have to view the source to see your invoice text.
http://shop.craigphillips.biz/index.php?option=com_virtuemart&view=invoice&layout=mail_raw&virtuemart_order_id=4&tmpl=component

Pass php variable through an AJAX refresh

I simply explain my "problem". I know nothing about JS and AJAX. But I'd make a simple AJAX function:
My Menu "projects" displays the last 5 projects to which the user is involved
When you click on one of these projects, a small drop-down list appears and you can choose "Tasks", "presentation", "Discussions", etc..
When you click on "Tasks" for example, the right part of the website is updated by displaying tasks on the project.
Not refreshing the entire page, just a div on the right.
I have to pass the ID of the project that I want to see the tasks to the right div (which simply loads tasks.php) so that it displays project tasks that I selected!
By asking a few people I was advised to pass the ID of the project by putting it in a "rel" of the div of the project, that I would recover after tasks.php, only I did not have a clue how to put it into practice, as simply as possible!
If you could help me, it would be very helpful :)
Seems like all you need is to build a url to your php page. Something along the lines of tasks.php?projectId=[project id goes here]. This url would be built when the user clicked on one of the projects.
For the request itself, I suggest you use jQuery's $.get() function (http://api.jquery.com/jQuery.get/).
In PHP, you could then use $_GET["projectId"] to retrieve the value, and act accordingly. As far as how to transfer data between the two, I'd recommend encoding your PHP response as json (using the proper content encoding, a simple set of header directives will do), obviously you'll need to fomat the JSON to something like:
{tasks: [{id: 'task1', name: 'My task', ...}, {id: 'task2', name: 'my other task', ...}]}
Does this answer your question?

Backbone.js - don't render view/template again

In my app I have a list of products and when you click on a product, a Fancybox opens to show the product details.
Now when the user closes the Fancybox, I change the URL back from '#/product-name' to '#' and the list of products is rendered again, even though it is already there.
My question is:
How do I avoid the product list from being rendered again?
So somewhere either in the list action of my controller or the list view I want to check if the product list is already rendered and don't render it again.
It feels like something that should be possible to accomplish quite easily but I can't get it right.
All ideas appreciated!
EDIT: edited for clarification
Have a look at backbone:s saveLocation method. It doesn't trigger a hashchange event.
You only need to change the hash part of your url.
window.location.hash = ""

Magento : create ajax dropdown populated with labels of 3 product's attributes.

Greetings,
I'm, unluckily in need of having this :
Product has (lets say) 6 attributes with "Yes/No" values.
I need a dropdown on that product's page that will populate with attributes with "yes" value.
attributes are :bundle1,bundle2....,bundle6.
When selection is made - I need to know whats have been selected to pass that to php on that page.
I have no idea what preexists in Magento (in terms of Ajax snippets) that could be used for this, searching for solution...
I used additional request.js and pulled attributes from a newly created table in DB (manually, for 1 product, just for test) and it works.
But, thats not idea, I dont want to do it manually everytime.
Syntax is killling me.
Thank you.
This may not be helpful at all... But I just recently created a module that taps into Magento's ajax autopopulate functionality. What this module does is does an autopopulate of all the manufacturers, depending on the string you are typing in. I know this isn't directly what you are wanting to do, but this may help you get started, at least with the ajax:
/app/etc/modules/Ash_Manufacturers.xml
http://pastie.org/841014
/app/code/local/Ash/Manufacturers/etc/config.xml
http://pastie.org/841017
/app/code/local/Ash/Manufacturers/controllers/IndexController.php
http://pastie.org/841018
/app/code/local/Ash/Manufacturers/Block/Manufacturers.php
http://pastie.org/841020
Look at rows 79-92 on this one:
/app/design/frontend/default/ash/template/catalog/layer/filter.phtml : http://pastie.org/841027

BEA Publisher Woes

I'm using BEA's Publisher product with ALUI. I want to have a simple portlet that just displays Content Items that I've published, but after playing with it for a couple of hours, I find myself stuck.
I have a Data Entry template that just takes a name and a file, and a presentation template associated with that. But I can't figure out how to make the presentation template display a list of published content items associated with the Data Entry template.
I tried using the Tag Helper and I saw that the file properties were available, e.g. name, location, length, however I can't get the template to actually display the information.
Also, since I can't publish said presentation template (you aren't allowed to publish a presentation template associated with a data entry template), I have to make ANOTHER presentation template, and include the first one, and then make a new portlet that displays that second template. Is this how it's supposed to work? It seems awfully complicated for such a simple task.
I would greatly appreciate any input anyone can give. Thanks!
In case anyone else runs into this:
http://forums.oracle.com/forums/thread.jspa?messageID=3171395&#3171395

Resources