-
Notifications
You must be signed in to change notification settings - Fork 399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble editing link text #558
Comments
@ScotsScripts sort of - the
|
I can't find any documentation on fixtures. When I added "data-fixture" to the A tag the editor wouldn't start. Do you have any examples of click-to-edit link text anywhere? |
Is there any documentation at all on using fixtures without trying to decypher the sandbox code? Something simple with, "This is how it's done" style information? |
There's some basic info on the initialising the editor for fixtures on this page: http://getcontenttools.com/api/content-tools (search for fixture). The sandbox demo within the project repo includes a fixture example in the project. That's all there is right now I'm afraid. |
Problem is the sandbox.js is quite different then your tutorial js and I'm feeling frustrated trying to figure out how to get the fixtures from the sandbox.js to work in the tutorial style js. Any hints? |
@ScotsScripts can you post the code you have for initializing your editor please? |
I feel like I'm getting closer, however this line: editor.init( '*[data-editable]', '[data-fixture]', 'data-name'); gets this error: uncaught TypeError: this._fixtureTest is not a function Here's what I have. The editing, saving, and image uploading/manipulation all work (not now, but before I started added fixture stuff.) Unfortunately I'm not even close to an expert js developer. Instead I rely on examples and tutorials and for Contenttools there just isn't that much stuff out there. Thanks for taking a look at this.
|
Can you try changing the line to:
The first argument is a CSS query that should capture both editable and fixture regions. |
That definitely helped quite a bit, the link fixtures seem to be working. That solves the issue of trying to make it easy to edit link button text/targets. What a relief! I'm also trying to get image fixtures to work. The code below is basically the same as the sandbox but when I click the pencil icon to edit the image in this code disappears from view as well as from the source. The background image style code is still in there as a background url but not actually loading (it does exist on the path.)
|
Fixtures are a pain. It took me quite some time to finally figure out that a fixture returns the entire element rather than just the part that's being edited. How do you deal with this? Do you have code in your back end that parses fixtures differently than non-fixtures? The way I'm doing it for "normal" editable areas is saving each chunk in a db and then replacing stuff in the master template. However with fixtures it appears I'll need to figure out a way to replace the entire <a element because that's what is getting passed to my ajax processing file to be saved. |
I save fixtures in the same way I save regions (e.g whatever the output of the Region
Fixture
As you can see the only real difference is that with fixture the template inserts the content in the root region element where as with fixtures the whole root element is replaced when. In both cases if there's not content in the database for the region or fixture a default placeholder to get the user started is provided. |
Thanks, that gives me an idea and I won't have to break what I've already done too much. |
Do you ever save data simply as a flat file in the page or do you always save it in chunks in a db? |
I've done both before, the content tools website is an example of where I save the content in the editor directly into the template, through I more commonly use the db as that's the approach out in-house CMS takes. |
Contenttools is set up to send the "regions" to the ajax page, does it also send the entire page? I'm thinking about saving as a flat file but was hoping to not have to parse it out for replacing region data one at a time. |
This tutorial actual covers the approach I take to saving content on the ContentTools - http://getcontenttools.com/tutorials/saving-strategies I don't save the entire page, just the regions, but I update those regions within the HTML template itself. |
Thanks again for your help! |
I have this:
When I click the "pencil" the editor adds a P tag and the "edit this link text" is not editable.
Before I go any further, is what I'm trying to do possible with contenttools? I'd like to hard code links but allow editing of the link text.
The text was updated successfully, but these errors were encountered: