Jennifer S Posted February 5, 2013 Share Posted February 5, 2013 Here's what I'm doing: I added a repeater field to my basic page type to hold blocks of content to be called as modal pop-up windows as needed by editors. Ideally I could add a box to the Insert Link dialog in the TinyMCE editor and they could choose to insert a link to any and all instances of their repeating content just like a Page or File. In lieu of this, I'd like to output the correct link tag to make the modal appear as part of the field description. I'm currently using an instance of the Title field to use as the unique identifier in the HTML for the pop-up. I sense I may be going about this in an entirely backward fashion. Advice is welcome. J Link to comment Share on other sites More sharing options...
ryan Posted February 6, 2013 Share Posted February 6, 2013 I'm not sure that I totally understand what you are attempting, but I'll pretend I do. With modals and such, you are already relying upon javascript, so it seems like everything else could be accomplished with javascript as well. What you would do is probably link to anchor names in PW, like "#this-item" and "#that-item" or whatever. And those anchor names could match up to <div id='this-item'>...</div>, <div id='that-item'>...</div>, etc. Or you could just look for them to trigger a modal window. Your $(document).ready() function would add click event handlers to any such anchor links. $(document).ready(function() { $("a[href^=#]").click(function() { var anchor = $(this).attr('href'); $(anchor).show(); // or open a modal or something }); }); Link to comment Share on other sites More sharing options...
Jennifer S Posted February 7, 2013 Author Share Posted February 7, 2013 Yes. The hard part, I think, is making it clear to editors what to add to their text content to trigger the corresponding modal box. Which is why I was investigating using a "smart" field description that appended the correct ID to an example link tag that editors could then copy and paste as needed, once they added each piece of modal content as a repeating field. I'm also looking into other means of progressive disclosure because I think relying too heavily on pop-up windows is probably not optimal. Link to comment Share on other sites More sharing options...
ryan Posted February 8, 2013 Share Posted February 8, 2013 I'm still totally confused about exactly what you are doing but it definitely sounds challenging and interesting. Please let us know what solution you ultimately find. A screenshot might ultimately help to clarify too. Link to comment Share on other sites More sharing options...
Jennifer S Posted February 11, 2013 Author Share Posted February 11, 2013 I think I am talking about a way to access the content of repeating fields (or any field, for that matter) through the admin/editing panel, as if they were assets like images or files. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now