Hi,
first of all, thanks for this great piece of code (it seems to be =D)!
I just tried to install the package for the first time follwing the tutorial at
http://www.bobsguides.com/newspublisher-tutorial.html
I use 2.1rc4 Traditional & NewsPublisher 1.0.7b1 (could 2.1rc4 may be a problem?)
I created the NewsPublisher Resource with the snippet call (for the Form) and I also included the Button Snippet in my main template (for editing existing resources...), so far so good, the Button "edit" appears as expected in the bottom right corner but only as a Text with gray background (see screenshot below)
seems mostly unstyled, and the same goes for the Form, it’s just a plain white page with form elements...
Now the question (I haven’t found any screenshots of newsPublisher in action): How should it look when working correctly...I couldn’t find the link to the assets/components/newsplubisher/css/newspublisher.css file anywhere, do I have to add it manually?
sorry for this dumb question, but I digged through the snippets and class files in core/components/newspublisher and I couldn’t find anything that adds the css to the page [EDIT: it is there, newspublisher.class.php @ line 350]...so what I would appreciate very much are some screenshots of a working example of Newspublisher...is the Form displayed as an overlay over the existing page or does the click on the edit button open a new page (as it is now on my installation)?
thanks for any answer!
EDIT1: OK, now it’s looking much better...I changed the template of the NewsPublisher Resource from "emtpy" to the main Template and now the css is loaded (not very beautiful but it’s there =D)...but the Edit Button looks still somehow unstyled, or is this just it’s normal look (see the screenshot above)?
EDIT 1.1: Added some styling to my normal stylesheet for the Edit-Button:
/* NewsPublisher Edit Button */
input.np_edit_this_button {
background: rgba(255, 255, 255, 0.75);
border: 1px solid #FFFFFF;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
padding: 5px;
text-align: center;
width: 100px;
}
input.np_edit_this_button:hover {
background: rgba(255, 255, 255, 1);
}
EDIT2: Now that’s what I’m talking about...just touching the surface of this mighty component! What a great piece of code, thank you very much for sharing your work!
EDIT3: OK, I have 2 contexts (babel, i18n) in this particular project and NewsPublisher made some problems when redirecting after saving some changes to a resource, it seems to ignore the friendly URL stuff and just puts /index?id=x instead of alias.html...so I digged a bit into it and commented out the 2 last lines of the forward function in the newspublisher.class.php file @ lines 1230 & 1231
/* ToDo: The next two lines can probably be removed once makeUrl() and sendRedirect() are updated */
//$controller = $this->modx->getOption('request_controller',null,'index.php');
//$goToUrl = $controller . '?id=' . $postId;
and I also changed lines 1208-1210 to (just changed id to alias)
if (empty($postId)) {
$postId = $this->existing? $this->existing : $this->resource->get('alias');
}
now it works perfectly and redirects to the edited page!