holmescreek

Members
  • Content count

    34
  • Joined

  • Last visited

Community Reputation

6 Neutral

About holmescreek

  • Rank
    Jr. Member
  • Birthday June 30

Profile Information

  • Gender
    Not Telling
  • Location
    Florida, USA
  1. Thanks, that fixed it. There was a space between mystyles: and /site/modules/ ... the the correct syntax mystyles:/site/... and not mystyles :/site/... A note for other readers, the Styles drop-down wasn't displaying anything after the change quoted above. However changing the style name in the mystyles.js file from: CKEDITOR.stylesSet.add( 'default', [ to: CKEDITOR.stylesSet.add( 'mystyles', [ fixed the issue of the styles list being empty. @Macrura - thanks!
  2. Thanks adrian & Robin S for the additional information.
  3. This question has probably been beaten to death - think I'm approaching this wrong. Anyway, I've got a textarea input field that uses ckeditor. Under the fields Input section I managed to add my custom style sheet in the 'Custom Editor CSS File (regular mode) section for instance: /site/templates/css/ckeditor.css This seems to work fine. What I'm trying to do now is add a custom style to the ckeditor styles menu, for instance, called .green_button (p.s. in the ckeditor styles.js I added this to the inline section : { name: 'Green Button', element: 'a', attributes: { 'class': 'button' } }, Ok, onto the problem... I notice that PW, by default, is using /wire/modules/inputfield/inputfieldCKEditor/ckeditor-4.5.10/styles.js So, I copied this into /site/templates/js/mystyles.js Next, I added the above to the 'Custom Editor JS Styles Set' field, however, it doesn't seem to load myckeditorstyles.js -- rather continues to load the one from the /wire/modules... folder. I cleared all history and caching in Safari (also tried Chrome, etc). I'm wondering if there is something else I need to do to have PW load my /site/templates/js/myckeditorstyles.js instead of the one in /wire/modules.../ckeditor-4.5.10/styles.js ? Thanks!
  4. Thanks, that is exactly what I was needing, Zeka. I kept trying to use $pages->find and set a limit=4, sort=random type of selection. Your solution above worked.
  5. No. The only page is called testimonials, which uses a template named testimonials which contains the field testimonials_repeater. Thus something like: $testimonials = $page->testimonials->testimonials_repeater->getRandom(4) also tried $testimonials = $page->testimonials->getRandom(4); but, both return an undefined function for getRandom();
  6. Following the example from the PW docs I set up a a repeater. I'm trying to fetch random fields from a repeater, for instance, display 4 random customer testimonials. Here is the basic setup in PW: created these fields: testimonial_text testimonial_name I then added them to a repeater field called: testimonials_repeater Next I added testimonials_repeater to a template called testimonials Last, I created a new page called Testimonials using the testimonials template. As far as fetching all the testimonials I'm doing this: <?php $testimonials = $pages->find("template=testimonials"); foreach($testimonials as $trepeater) { foreach($trepeater->testimonials_repeater as $t) { echo $t->testimonial_text . ' -' . $t->testimonial_name; }} ?> Could some please give me some guidance on how to pull, for instance, 4 random testimonials? I mean, I could stick the results in an array[] inside the foreach loops, then random sort the array, then output only 4, but there has to be a better way using PW. Also, is there a way to limit the number of records (customer testimonials) that can be added by the user? Repeaters just always seem to trip me up. :/ thanks much!
  7. Gotcha! I really appreciate your help on these topics and especially pointing me in the right direction on the API docs with the reference links.
  8. I do have another quick question. Basically when a user edits a song there is a drop down lists of artist names which the data comes from a Page type field called song_artist_selections. I was wondering when bulk adding records how to set the value of this field? pseudo code $mypage = new Page(); $artistname ='Elvis'; $mypage->set the song_artist_selection to 'Elvis' ... $mypage->save() P.S. where in the docs did you find information on the add() method? e.g. $mypage->song_mp3->add($mp3file); ? Thanks again.
  9. Thanks. I tested it and it uploaded the mp3 from a temp folder then added a new record. Final (snipped from my) code: $mp3file = 'temp/' . 'song1.mp3' $mypage->save(); $mypage->song_mp3->add($mp3file); $mypage->save();
  10. $mypage = new Page(); $mypage->template = "song"; $mypage->parent = $pages->get("/songs"); // root $mypage->title = "My New Song"; $mypage->song_number = "004"; $mypage->song_commentary ="this is the commentary"; $mypage->save(); Using the example above I was wondering if there is a way to supply the name of an mp3 file and when $mypage->save() executes the mp3 will be added to the processwire database and uploaded into its assets folder? For Example: I have a field song_mp3_file which is a File Type field. I have temporary copied all the mp3 files in templates/temp/ song1.mp3 song2.mp3 If I set a value like this, will PW know it is a File Field type and automatically upload it to its assets folder and add it to the database? $mypage->song_mp3_file = "temp/song1.mp3" The above code (at the top of the post) works fine to quickly add records, I just don't want to have to go into every song's page and manually upload each mp3. Thanks!
  11. I edited the question as you were composing. And I'm talking all backend with pw ... not front end ajax.
  12. Just one last question for future reference/projects. I only have a couple songs, not a huge set. Using PageListSelectMultiple input type. How well does it handle a thousand items/songs when the page loads? I was kust thinking in that case it might be best to do somethink like; Acoustic (1940's) song 1 song 2 Acoustic (1960's) song a song b
  13. Excellent! For a quick test - I created a temp_playlist template which contains the title and a field called temp_song_selector. The temp_song_selector is a page field with an input type of PageListSelectMultiple that uses the songs stored in Songs. That input type which is user sortable is exactly what I was looking for -- or maybe thinking too hard overlooked it. I'll play around with it tomorrow more in depth. Thank you so much.
  14. The songs are already under a page called Songs where you only create one entry per song. The same with Genres and Artists. Genres Rock Rap Artists Elvis Eagles Eminem Songs Blue Suede Shoes Hotel California Stan When you create a song, like "Hotel California", you can use a pull down (pagearray) to select the artist and genre. The problem is creating multiple playlists, where I can add songs to differing playlists and be able to sort the songs manually. The attached photos might help. The only problem with this solution is if you add a (child) to Acoustic you have to re-type in the song Title, then on the next page, my pagearray drop-down will let you select a song from Songs.
  15. edit: before reading through all of this. Is there a way to have PW display a page array drop down list to select a Title vs having to type in the Title when creating a new (child) page? --- I'm converting an old music site where custom built the back end to a responsive site and using processwire now as the back end. In my old site I can add a song, attach it to multiple genres and within the list of genres manually sort the songs. So here is what I have done in PW. 1. created a Genres page where I can add a child genre. The child genre is nothing but a template with the title field. 2. created a Artists page where I can add a child artist. The child artist is nothing more but a template with the title field. 3. I created a page called Songs. The songs page uses a template that has the following fields: title, song name, mp3 upload a select box for selecting the artist from a pagearray (see 2) a list of check boxes for assigning different genres to the song. (see 1) (for instance, a song can be in the genres Pop AND Nostalgia Thus : HOME Genres 3 Acoustic Nostalgia Artists 1 Elvis The Eagles Songs 2 (fig. A) Hound Dog Blue Sued Shoes Hotel California (acoustic) What I'm trying to achieve: I'd like to achieve a layout like this, or similar function that will let me add to a playlist of genres and be able to sort those songs manually without having to re-key each song for each genre. Play Lists 3 Acoustic (2) Blue Sued Shoes Hotel California Nostalgia (1) Blue Sued Shoes The Problem As you can see, if I were to add a child (blue suede Shoes) to Acoustic or Nostalgia, I would have to basically use a "song" template and re-enter all the information about the song. Ideally, it would be nice when adding a child to the Acoustic playlist I could just select a song already in Songs 2 (above). To get this type of listing in the back end: All the genres and child songs able to be manually sorted. Playlist 3 Acoustic 2 Blue Sued Shoes Hotel California Nostalgia 1 Blue Sued Shoes Pop 0 The only near solutions is to create a Genre template with a pagearray field which contains a repeater field for songs. This would work on a site with few items per Genre, but, the repeater field would hit in performance if there were thousands of songs. The only other though was to create a Play List page like so: Acoustic (2) Blue Suede Shoes Hotel California Nostalgia (1) Blue Sued Shoes In this scenario, the client adds a new child song to Acoustic. They would have to re-type the song title, press ok, then would be displayed a template that simply lets them select a song from drop-down that contains a pagearray containing the list of songs that I created see above (Fig. A) For what I want to do, this seems to be the only solution. It's just invonvenient if they go change the name in the Songs list they would have to go into Acoustic and change the Title field there to match. Ideally, if someone knows hows a way to modify PW to allow you to select an entry from a page array dropdown list vs the required Title field when creating a new child (page), that would be awesome! Can anyone suggest some tips or insights if I have overlooked anything?