Laravel method for implementing a process on all of the pages [closed] - laravel

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
I am developing a "help Link" system into my Laravel site which will allow the webmaster to place a helpful link to documentation on any page. The system will include a database table and model which will contain the following attributes:
Page : The page which will receive the link (url or page name.)
Selector : A jQuery selector for the div that the link will follow.
Link : The URL for the help link.
Text : The text that will appear in the link.
This system will use jQuery to add the links after the page has loaded, and will be able to function regardless of the composition of the pages (so long the page uses div sections.) I will be adding the script to the base template, which will receive a collection of help link models. Is there a way to create some php code which will send a filtered collection of models to every page? I want to avoid having to manually add the additions to every controller function.

Related

Facebook feed dialog deprecating custom fields

Facebook Feed Dialog 2.9 has deprecated the custom fields (name, caption, picture, description) - https://developers.facebook.com/docs/sharing/reference/feed-dialog.
I'm working on an AJAX site where all content and metadata is loaded dynamically. If I just use the link property, the metadata isn't set on initial retrieval of the page so the post doesn't contain the right content.
How can I share an AJAX page on Facebook without having to go down the route of prerendering static pages server side? Thanks
If you can program your page to populate the appropriate metatags on the page load based off of a variable http:/yoursite.com/yourpage.php?thisversion=1 then when you want to share version 1 of the page, you just share the URL with the appropriate variable to populate it. You can still remain on your current version of the page but when you share the URL that would prompt that specific version, facebook makes a call to that respective URL and pulls the appropriate metatags that would be populated by your variable without having to reload the page your are currently displaying. Sorry I don't have time at the moment but will try and comeback and add some sample code for clarity.

profile picture upload laravel & foundation framework

I have a registration form completed and would like to add a profile picture upload. Once the user clicks the browse, he can select the photo. Then he clicks ok/apply/ok and then the photo is reflected in the thumbnail area without page refreshing.
Once the user is happy with all fields input he can submit the form and with it the photo of course.
Anything that does this exists out there already? If not, please provide guidance on how to establish this feature.
Thanks,
I'm not aware of a ready made solution for this but there probably is something :-)
However, with Laravel this is beautifully simple. You've tagged your question ajax but I'll answer this assuming you're going to use an old fashioned server round trip (i.e a form submit).
1) In your template, add a file element to the form. http://laravel.com/docs/html#file-input
2) Add some javascript to the page that detects when a file is selected and shows the preview. Extensive tutorial here: http://www.html5rocks.com/en/tutorials/file/dndfiles/
3) In your controller, handle the file using the Input facade. http://laravel.com/docs/requests#files

Joomla component - how to convert standard php form into joomla component

Currently i have been using an iframe component to display a php page that i have written. the reason i used iframe rather than writing a joomla component in the first place was for 2 reasons, the information that is displayed in that page is from a remote mssql sever and the second was that i didnt really understand how to write one.
Now i have completed the creation of the php page that i display within the iframe, but now i need to be able to have it inherent within the joomla site, for both display reasons and security.
basically its a single page that displays information in a bunch of drop down boxes and then a submit button is clicked and it posts that information to another php page that again queries the mssql server and displays the results based on the post from the previous page.
query.php, posts some variables to results.php and is displayed in a table.
i have the functionality perfect, but i dont understand the documentation i have read so far. is there any simple component i can see the code of so that i can try and work out whats going on?
You might want to look at http://docs.joomla.org/J3.1:Developing_a_MVC_Component/Introduction and follow the process outlined.

AJAX suddenly not functioning in Wordpress site [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
A site I built back in November has been using AJAX to pull in content on a single page in Wordpress up until now. After the page loads initially and the static content appears, when a user clicks a name in a list, the static content is replaced with content pulled from a directory via AJAX. About two weeks ago, when a user clicks a name in that list, the static content disappears, but is not replaced. AJAX seems to be broken...? It's a Wordpress install. I have the same exact functionality working successfully on a "sister site" of the same nature.
The page can be found here: http://www.cleanse-nyc.com/?page_id=98
This is the code:
<div id="teamMenu">
<ul id="wCoach">
<h2>CLEANSE Wellness Coaches</h2>
<li class="hidden">Fernanda de la Puente</li>
</ul>
By clicking the name in the anchor tag, the relative content should appear using AJAX.
I've tried using Dev Tools to work out the issue, but I'm not seeing anything specific to the issue.
Anyone have any experience with this?
If you read the guide: http://jquerytools.org/documentation/performance.html it will explain that you need to either use full (and not include jquery), or alias $
GET http://cleansenyc.s3.amazonaws.com/2012/08/cleanse-team-bkg-pvt.jpg 404 (Not Found) www.cleanse-nyc.com:75
XHR finished loading: "http://www.cleanse-nyc.com/wp-content/themes/cleanse/AndreaMitchell.php". jquery.tools.min.js:38
Uncaught TypeError: Property '$' of object [object Object] is not a function
Right now jquery tools is using $. I would suggest you update the line
var $j = jQuery.noConflict();
to
var $ = jQuery.noConflict();
Alternatively the better fix is to use the bundled jquery. There is one with a /full that will load the tools,and automatically import jquery.js
e.g. current version
<script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
Will import both jquery and jquery tools.

Setting a value in MVC Sitemap node and accessing it in the action to differentiate, which button was clicked by user?

How do I set a value in MVC SiteMap Node and Access it in the action.
I am attaching an image file with my problem scenario and my question?
Can some one suggest me, how do I solve this problem?

Resources