Git Product home page Git Product logo

Comments (3)

ntd avatar ntd commented on June 11, 2024

Hi Nicolaas,

I just tested autotoc 1.2.0 against silverstripe 3.5.3 and it works as expected. Can you provide more info, e.g. silverstripe and autotoc versions, original HTML and augmented HTML, so I can try to replicate the problem here?

Also, why not extend HTMLText and add the Tocification in there as a method, just like Nice or Summary. This will just add the anchors.

Currently the autotoc feature is really bound to the controller, based on the assumption "one page - one table of contents". I don't think it makes much sense to bound it to every HTMLText instance.

from silverstripe-autotoc.

ntd avatar ntd commented on June 11, 2024

I updated the module for SilverStripe 4. I also added a couple of new template tags to address this issue.

Now you can use $OriginalContentField to explicitly access the original content field and $ContentField to access the augmented one. $Content by default should still return the augmented field (i.e. by default $Content == $ContentField) but there could be cases when this assumption is not true, e.g. if you define a getContent() method. In those cases, just use $ContentField.

@sunnysideup if you still have problems, feel free to reopen.

from silverstripe-autotoc.

sunnysideup avatar sunnysideup commented on June 11, 2024

thank you. Will do.

from silverstripe-autotoc.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.